Worked recipes
Each recipe is a complete list of steps. Give the action a trigger on the Actions page, then build the steps as shown. Every recipe works in Simple and Advanced mode alike (Adding and arranging steps).
Before you give a recipe a real trigger, you can try it on the Sandbox page.
Close the current tab
- Send keys presses Ctrl+W, which closes the current tab in browsers and most tabbed programs. Click the Keys box and press the combination.
The keys go to the window that has the focus. For a gesture drawn over a window in the background, turn on Activate the window under the gesture on the General page (General settings), so the keys reach the window you drew over.
Type a signature
- Type text types the text where the cursor is, as if you typed it.
For longer text, or text with line breaks, a typed shortcut on the Text expansion page is often simpler.
Move a window to the next screen
- Move window to monitor (the Move window chip) moves the window to the next screen, keeping its size and its place on the screen. Window is Target window: the window you drew the gesture over. Turn on Move the mouse with it to take the pointer along.
Screens are taken left to right, then top to bottom, and the last one wraps to the first. A maximized window stays maximized.
Maximize or restore the window under the gesture
Quick create… offers this action ready-made as Maximize or restore the window.
- Target window (
ContextGetWindow) with Save result aswindowkeeps the window under the gesture. - If… otherwise…, with Check set to A builtin's result and the builtin
Is window maximized (
WindowIsMaximized), its Window field$window. - Inside the If part, Restore window with Window
$windowrestores the window. - Inside the Otherwise part, Maximize window with Window
$windowmaximizes it.
Saving the window in step 1 is optional: each Window field could be Target window instead. Saving it once makes each later step's field shorter to read.
If the window is Notepad, save; otherwise say so
- If… otherwise…, Check set to A builtin's result, builtin Title contains text
(
WindowContainsTitle): Window is Target window, Text isNotepad. It is true when the window's title contains "Notepad", in any upper and lower case. - Inside the If part, Send keys presses Ctrl+S.
- Inside the Otherwise part, Show a notification shows a Title and a Message.
To test the program instead of the title, save the result of Program file name
(WindowGetExecutableName) and compare
it with Compare two values. That comparison is exact, so match the file name's upper and lower
case as Windows reports it.
Media keys
Send keys can't press media keys, so this recipe uses the KeyboardPressKey
builtin, which presses any key by its name.
- Press and release key (
KeyboardPressKey, from All N builtins…) with KeyVirtualKey.MediaPlayPausepresses Play/Pause.
Use one action per key:
| Key | Key name |
|---|---|
| Play/Pause | VirtualKey.MediaPlayPause |
| Next track | VirtualKey.MediaNextTrack |
| Previous track | VirtualKey.MediaPreviousTrack |
| Stop | VirtualKey.MediaStop |
| Volume up | VirtualKey.VolumeUp |
| Volume down | VirtualKey.VolumeDown |
| Mute | VirtualKey.VolumeMute |
Type the name exactly, with the same capitals. Every key's name is listed under Named constants.
With Send media and browser keys as commands on, these keys are sent as commands to the window with the focus instead (Script settings).
Paste as plain text
Quick create… offers this action ready-made as Paste as plain text.
- Clipboard text with Save result as
textreads the copied text without its formatting. - Paste text with Text
$textputs that plain text on the clipboard and pastes it.
Ask before closing a window
- Show a message box (
UIShowMessageBox) shows a message box and waits. MessageClose this window?, TitleClose, ButtonsYesNo, IconQuestion, Save result asanswer. It gives the name of the button pressed. - If…, Check set to Compare two values: Value
$answer, is equal to (==), Compared withYes. - Inside the block, Close window with Window Target window asks the window to close, as its close button would.
Press a key several times
- Repeat a number of times, Times
5. - Inside it, Send keys presses Down.
- Wait
50milliseconds gives the program time to keep up.
Open a program, or switch to it
- Switch to or start a program (
ShellRunOrActivate) with Program file namenotepad.exebrings Notepad to the front if it is running, and starts it if not..exeis optional:notepadworks too. Arguments after the name, such as a file to open, are used only when the program has to be started. Running programs are matched by the file name of the first word, so a path that contains spaces and is followed by arguments goes in single quotes.
To always start a new copy, or to open a file, folder or web address, use Run or open
(ShellRun) instead, or
Quick create…'s Open a program, file or website.