Skip to main content
Topic: Little gem : AutoHotKey  (Read 1886 times) previous topic - next topic

Little gem : AutoHotKey

Using two screens, the key combination CTRL+F8 that is defined as "repeat Last User Tool" doesn't work for me since Windows intercepts my command and manipulates my screen settings.
But, I found a useful little tool that let me assign a specific key to a sequence of keystrokes: AutoHotKey (https://autohotkey.com/)

After installation of the AutoHotKey program, create a little text based script, right click on it and choose "run script" (or double click on it if it has the .ahk extension, because then running is the default action). As soon as you touch the hotkey, your bunch of keystrokes is executed.

This little script defines function key F12 as my "repeat Last User Tool":

Code: [Select · Download]
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

if WinExist("ahk_exe NWC2.exe")
   WinActivate, ahk_exe NWC2.exe

f12::
 send, {alt down}t{alt up}e
Return


Following the information in the AutoHotKey documentation, even combination of different key definitions (also for different programs) is possible in one ahk.script.

Bart