- This line was added.
- This line was removed.
- Formatting was changed.
Do live your life with part numbers piled up all around you? Do you have them flying at you in email, spreadsheets, csv, pdfs, schematics, and websites where you end up in a loop:
Well Autohokey might be able to help with part number wrangling by giving you quick shortcuts from any application to Digikey or Google search.
What is AutoHotkey?
From their website:
AutoHotkey (AHK) is a free, open-source macro-creation and automation software for Windows that allows users to automate repetitive tasks. It is driven by a scripting language that was initially aimed at providing keyboard shortcuts, otherwise known as hotkeys, that over time evolved into a full-fledged scripting language.
Why use AutoHotkey?
My job constantly surrounds me with part numbers and those numbers come from all kinds of places. Repetitive processes are begging to be optimized and the constant loop of copying information to look up things on digikey.com or Google is something that occurs dozens of times a day. Sometimes a people optimize for real time savings, sometimes they do it because they're engineers, I'm not quite sure which one this is. This isn't, a full tutorial, just a bit of code to get your life a little more automated.
- The first steps to getting up and running would be to download and install AutoHotkey.
- Then you'll need to create a text file with the .akh extension.
- Write or paste your code into the that file and save it.
- Double-click on it to run.
- You're on your way to hotkey heaven.
Editing your Script
If AutoHotkey is running you should see anicon in your tray. To edit the file at some point in the future right click on theicon and select Edit this Script. After you make changes you'll need to save the script in your text editor and then click Reload This Script to make the changes take effect.
Running at Startup
If you want to have it run when your PC starts, put a shortcut to the file in your Windows startup folder.
On this page:
- Download this digikey_shortcut.ahk script file
- Doubleclick on the digikey_shortcut.ahk file
- Use Ctrl+Shift+d (digikey.com) or Ctrl+Shift+g (google.com) to search for datasheets, parts status, and buy parts faster regardless of what programs you are using at the time.
Example 1 - digikey.com search shortcut
A basic script which uses ctrl+shift+d to search Digikey.com for a bit of highlighted text might look something like this:
The basic syntax is covered here. In the examples we'll use these keys as reference:
The shortcut combination is expressed using a series of characters followed by a double colon ::
^+d - tells AutoHotkey to respond to the combination Ctrl+Shift+d and perform the commands after the double colon ::
Send, ^c - executes Ctrl+c (the copy to clipboard shortcut).
Sleep 150 - It seems to need this brief delay to run reliably.
Run,- opens this webpage using the default browser on your system.
%clipboard% - inserts the contents of your clipboard.
Return - The end of a hokey command.
Highlight a part in an email and press Ctrl+Shift+d to search Digikey.com
The same with websites.
Example 2 - add google shortcut
If you wanted to add a similar ctrl+shift+g shortcut for a google search you could do something like this:
Highlight the part in a schematic or PDF and input Ctrl+Shift+g to search on google.
Example 3 - limit which programs use the shortcut
If you are a regular user of applications with their own shortcut definitions, like text editors or IDEs, you can exclude AutoHotkey from running on those windows using the .exe name, window name, or other qualifiers (learn more).
GroupAdd Editors, ahk_exe sublime_text.exe
GroupAdd Editors, ahk_exe atom.exe
#IfWinNotActive ahk_group Editors
There's a wide variety of really complex tasks which can be automated with AutoHotkey. One can do text processing, cross program data entry and automation, abbreviation expansion, and more with AutoHotkey. It's just one more of those tools in the tool belt for programmers, engineers, and anyone else has an obsessive need to optimize their workflows.