AutoHotkey is a scripting language to automate certain action in Windows environment. It’s super easy to integrate anywhere you want because it compiles into executable file and you can run it anywhere after. Frankly speaking it’s mostly used to create some advanced key bindings. But in some cases it’s used for powerful programs such as window tiling manager – bug.n.
I used it mostly for hotkey but today I made a nice script to automate quite a repetitive action I do with downloaded files. When I download a new model to print from Thingiverse I copy the original archive into my special folder, unarchiving it and then print it. Doing that manually takes not a lot of time but for purity sake, I made a script which I put into “Send to” menu in Windows.
The script itself is very easy to understand. Let’s look at the code:
So the idea is that Windows pass a file name to the script when you choose Send To item. It’s perfectly fine for AHK script to accept arguments in a simple way. It has several utility functions such as SplitPath to handle string manipulations or WinActivate to work with applications’ instances.
If you’re obsessed with using shortcuts everywhere, go check it out. I prefprefer to install my soft with chocolatey, so if you have it as well, all you need to do is:
choco install autohotkey
Also, there are several extensions for VSCode to make scripts making even easier. Enjoy!