Sunday 16 September 2012

Hotkeys

16:29 Posted by Jurgens Krause , No comments
This one is just for Windows users.

If you haven't heard of the application "Autohotkey" might I suggest you have a look. It enables you to create complex scripts to automate repetitive tasks.

Installation is quite simple, just download and run the installer.

Once you have it up and running simply right click on the icon in the taskbar, and select "Edit this script". The default script only has one shortcut:

^!n::
IfWinExist Untitled - Notepad
WinActivate
else
Run Notepad
return


Let's take a look at what it does:
First it defines the hotkey, in this case:
^ - ctrl
! - alt
n - n

When the hotkey (ctrl+alt+n) is pressed:
IfWinExist Untitled - Notepad - Checks if notepad is running
WinActivate - If true it brings it to the foreground and puts focus on it
else
 Run Notepad 
- self explanitory (though if you use an application not reference in the system %path% varable you have to give the full path)
return
- end of hotkey

as a further example, this is the shortcut I use to ping the address currently in the system clipboard

^!p::
address=%clipboard%
run, ping %address% -t
return

If you have any other cool ideas on using hotkeys, let me know.

0 comments:

Post a Comment