Recipes

Useful recipes

Copy an entry into your personal command list, add a free shortcut or alias, save and restart. Use unique names.

Open a program

ini
[recipe_notepad]
type=f
code='''
Run("notepad.exe")
'''

Quote the executable within the command line when its path contains spaces.

ahk
Run('"D:\My Tools\App.exe"')

Insert common text

ini
[recipe_text]
type=f
code='''
SendText("Thanks, I will check and get back to you.")
'''

Text goes to the current input focus. Test in an empty document first.

Copy the trigger window's title

ini
[recipe_copy_title]
type=f
code='''
if this.Has("title")
{
	A_Clipboard := this["title"]
}
'''

Use a mouse trigger that supplies title.

Show call context

ini
[recipe_context]
type=f
code='''
text := ""
for key, value in this
{
	text .= key ": " value "`n"
}
MsgBox(text)
'''

Periodic reminder

ini
[recipe_reminder]
type=f
task=em:30
code='''
MsgBox("Time for a short break.", "Diatom")
'''

The first run follows the internal minute boundary. Exiting Diatom stops scheduling. See the gesture reference for copy, search and window-operation definitions.

User guide

Loading the guide…