Keyboard: Script V2 Extra Quality
// Define a temporary layer shift while holding CapsLock hold(Key_CapsLock) activate_layer(Layer_Navigation); layer(Layer_Navigation) trigger(Key_I) action: tap(Key_UpArrow); trigger(Key_K) action: tap(Key_DownArrow); trigger(Key_J) action: tap(Key_LeftArrow); trigger(Key_L) action: tap(Key_RightArrow); Use code with caution. Using Variables for Toggles
Scripts can be more easily organized into functions and objects, allowing for more professional software development practices.
Need to remap keys on the fly based on which app is active? V2 makes this elegant:
// Example: Pressing Ctrl + Alt + T opens a terminal ^!t:: Run("terminal.exe") return Use code with caution. Hotstrings (Text Expansion) keyboard script v2
Keyboard Script v2 strikes a perfect balance between power and simplicity. By moving away from the convoluted syntax of older automation tools, v2 provides an accessible entry point for beginners while maintaining the deep programmatic control required by advanced power users. By mastering its triggers, hotstrings, and logical flows, you can eliminate mundane digital friction and completely transform your daily workflow. To help me tailor this to your needs, tell me: What specific are you writing scripts for? What task or application are you trying to automate? Share public link
Right-click the file and select Edit Script . A basic v2 "Hello World" hotkey looks like this: autohotkey ^j:: Send "My First Script" Use code with caution.
; Create an object with properties myCar := {} myCar.make := "Toyota" myCar.model := "Camry" myCar.year := 2024 // Define a temporary layer shift while holding
; Disable the annoying NumLock key NumLock::Return
If you'd like to implement this on your own setup, let me know:
To get the most out of your automation script, consider these best practices: V2 makes this elegant: // Example: Pressing Ctrl
: Directly outputs a sequence of alphanumeric characters. 3. Advanced Features: Layers and Variables
GetValue() return this.currentValue
The noodle bar’s lights flickered. Outside, the Enforcers' sirens began to wail, their proximity sensors picking up the illegal mechanical frequency.