AutoHotKey
Over the weekend, I spent some time exploring the potential of AutoHotKey.
This programme was not designed specifically for architects, but it has useful applications in the field nevertheless.
Essentially, this is a programming language that lets users code their own keyboard shortcuts.
The AHK file has to be open for it to work, but by appending a script file to the startup folder (accessable on windows by hitting Windows+R and entering "shall:startup" into the resulting pop-up window), you can open and run it in the background whenever your computer starts up.
I've only spent a couple of hours playing around with it, but already, I've created a few cool shortcuts I'd like to share. Let's start with a super simple one:
#q:: { Send "benjaminjamesrowley@gmail.com" }
Let's go line by line:
- Declare a keyboard combination. I've chosen Windows (indicated by the #) + Q. The double colon indicates the end of my declaration. A full list of modifier keys is available in the documentation.
- Open the function body.
- The function I wish to execute. In this case, it consists of a single line, which types my email address out for me.
- Close the function body.
Let's look at a (slightly) more complicated example. Every so often, I need to add today's date at the beginning of a set of file names. Only certain files in a folder need changing, and there are no consistent rules: running a python script is more effort than it's worth. AutoHotKey strikes the perfect balance between flexibility and automation. I created a script that will take whatever I have highlighted (the file name after I click "Rename"), copy it, add today's date to the beginning, then paste it back into the file name, all in a matter of miliseconds. Let's take a look:
#d:: { Send('^c') CurrentDate := FormatTime(, "yyyyMMdd_") Send(CurrentDate) Send('^v') }
Again, let's take this line by line:
- Windows + D.
- Open the function body.
- Copy the highlighted text.
- Assign the current date to a variable CurrentDate. The date format "yyyyMMdd" returns year-month-day (e.g. 20241216). I also add an underscore.
- Type the value of CurrentDate. This will replace the text we had highlighted.
- Paste the value we copied at the beginning of the function, so that it appears after our current date.
With googling, this took me about ten minutes to set up, but it'll save an average of thirty seconds a day. That's about 2 hours a year - a pretty good ROI, if you ask me!
Work tends to be cyclical - there are quiet moments and hectic moments. It's taken me a while to learn, but setting up automations like this during the quiet moments yields massive returns during the hectic ones. I'll be playing around with AutoHotKey whenever I find myself with a couple of extra hours, and I'll post any useful tricks I find here under the tag "AutoHotKey".
Comments
Post a Comment