Three common AHK command forms
Store list entries in <Diatom>\src\user\my_commands.toml. A command runs when triggered or called by another command.
Function body
[open_notepad]
type=f
key=^!F9
code='''
Run("notepad.exe")
'''f treats code as a function body and supplies its call map as this. Review shortcut conflicts with the starter examples before adding another Ctrl+Alt+F9 binding.
Function call
[open_notepad_by_function]
type=c
fn=Run
ps=notepad.exeps is normally one string argument. A comma inside it does not split arguments. A definition with fn and no type normally becomes c. fn=Run notepad.exe can also split into a function name and argument.
Full independent script
Save this as debug_notepad.ahk, add a trigger in its header and restart to register that trigger.
;? type=e,read=1
Run("notepad.exe")
ExitApp()read=1 rereads the file when creating the independent instance. Complete scripts obtain their call map through A_Args.
Syntax essentials
Assignment uses :=. Normal Windows paths use a single backslash. AHK escapes use the backtick. Triple quotes belong to the command-list format. Use the matching AHK_Z interpreter provided with Diatom.
Reusable functions can retain globals and compiled definitions. See execution modes.