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.
Zoom with the right button and the wheel
Two actions, each with a wheel trigger on the right button: Wheel up zooms in, Wheel down zooms out. Put them in the app group of the program you zoom, such as a PDF or comic reader.
- In the zoom-in action, Send keys presses Ctrl and the plus key on the number pad, the zoom-in shortcut of most programs, SumatraPDF among them. Click the Keys box and press the combination.
- The zoom-out action is the same with Ctrl and the minus key on the number pad.
Hold the right button over the program and turn the wheel: each tick zooms one step, and letting go opens no context menu. Some programs zoom with the plus and minus keys alone, MComix among them: for those, leave out Ctrl. If the program uses other shortcuts, set those instead.
Middle-click with the right and left buttons
One action with a button chord trigger: Draw button Right button, Other button Left button. Put it in the app group of your browser, or in Global for every program.
- Click clicks the middle button where the pointer is. Set X to Mouse X position, Y to
Mouse Y position and Mouse button to
MouseButton.Middle.
Hold the right button over a link and click the left button: the browser opens the link in a new tab, as a middle click does, and no context menu opens. Click the left button again while you still hold the right one to open the next link under the pointer.
Use the side buttons as extra buttons
Any mouse button turned on as a draw button works like the right button: a click on its own still does what it always did, and held, it turns the wheel or a second button into an action. Here, holding side button 1 and turning the wheel presses the arrow keys, and holding side button 2 and turning the wheel changes the volume.
-
On the General page, turn on Side button 1 and Side button 2 under Draw buttons (General settings).
-
Add four actions, in Global or in the app group of one program, each with a wheel trigger:
Action Draw button Direction Step Up arrow Side button 1 Wheel up Send keys, the Up arrow key Down arrow Side button 1 Wheel down Send keys, the Down arrow key Volume up Side button 2 Wheel up Press and release key, VirtualKey.VolumeUpVolume down Side button 2 Wheel down Press and release key, VirtualKey.VolumeDown
- For Send keys, click the Keys box and press the arrow key. The volume keys are pressed as in Media keys.
Two side buttons together work as a button chord: Draw button Side button 1 with Other button Side button 2 runs when you hold side button 1 and click side button 2. Draw button Side button 2 with Other button Side button 1 is a different chord, so it can run a different action. The middle button works the same way once it is a draw button, for example to Shift-click by holding the middle button and clicking the left one.
A side button can also be held while you press a key: set Then press to A key (Hold a button, press a key). And two quick taps, side button 1 and then side button 2, can run an action of their own with a tap sequence trigger, once Tap sequences is on.
What changes once a button is a draw button:
- Its own click still reaches the program, but when you let go of the button, not when you press it.
- Holding it and moving the mouse draws a gesture, as with the right button. Holding it still for longer than the cancel timeout gives the press back to the program (Cancel timeout).
- The middle button: a browser's scrolling by holding the middle button starts only once you have held it still for the cancel timeout, because moving draws a gesture instead.
- In a program that needs the button untouched, such as a game, turn off Draw buttons start gestures here in its app group (Advanced mode, App groups), or add it to an ignore group.
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
(
WindowTitleContains): 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.