Sandbox
The Sandbox page is a practice area. You lay out pretend windows on a pretend desktop, build some steps, and run them. The engine runs them against the pretend windows only and sends back what happened, which the page replays step by step. Nothing on your real desktop is touched: the pretend windows are drawings, not real windows.
① Run the steps. ② The pretend desktop. ③ What to run, and what the run starts with.
The pretend desktop
The desktop has one or two screens and up to 16 pretend windows, called stand-ins. The first time you open the page, it holds a Practice desktop layout with a few stand-ins and a short example.
- Select a stand-in by clicking it; click empty desktop to clear the selection. Drag its title bar to move it, and its corner to resize it (in the Normal state only).
- The selected stand-in has a toolbar: Window settings, Start the gesture over this window, Bring forward, Send backward, Duplicate and Remove.
- Window settings sets its Title, Class name, Program name, position and size, State (Normal, Minimized or Maximized) and Always on top. Steps that look for a window by title, class or program find the stand-ins by these values.
- One stand-in carries the Gesture badge: the run behaves as if the gesture had been drawn over it, so it is the Target window. At the start of a run, the front-most visible stand-in has the focus, and the pointer is in the middle of the gesture's window.
- A minimized stand-in is drawn faded at the place it would return to, so you can still select it.
- Add window adds a stand-in.
Each screen has a chip in its bottom-right corner, such as "Main screen · 1920 × 1080". Click it to set the screen's size; the second screen's chip also has Remove screen. With one screen, Add screen adds a second one to the right of the first.
Advanced mode. A screen's settings also hold its Scale (100–500 %) and its Friendly name, and show its Device path. Scripts can find a screen by its device path or by this name.
The desktop is always drawn left to right, in every language, because screen positions don't mirror.
Using the keyboard
Press Tab to move between stand-ins; the focused one is selected. Arrow keys move it 10 pixels (1 pixel with Ctrl), Shift+arrow keys resize it, Enter or F2 opens its settings, and Delete removes it. Esc closes a settings box.
Layouts
A layout is a desktop with its stand-ins, screens, starting clipboard and message box answers. Pick a layout from the Layout list. The Layout options button next to it holds New layout (a copy of the current one), Rename layout and Delete layout. The last layout can't be deleted, and a name must be unique.
Layouts and the steps you were trying are kept on this computer for your Windows account, separately from your configuration. They are not exported and not part of the configuration file.
What to run
The What to run tab holds a Steps editor, the same as an action's (The Steps editor).
Advanced mode. A Steps / Script switch above the editor lets you try a script instead. Switching to Script with steps offers to translate them, as on the Actions page. Back in Simple mode, the page shows Steps again; the script is kept.
Before the run
The pretend desktop has its own clipboard and its own message boxes. The Before the run tab sets them up. The line under the desktop summarizes both; click it to open the tab.
- Clipboard: the text the clipboard holds when a run starts (up to 256 characters). Leave it empty to start with an empty clipboard. Your real clipboard is never read or changed.
- Message box answers: one row per message box the run shows (Box 1, Box 2 and so on), up to 16. Each box gets the next answer in the list. If that answer isn't one of the box's buttons, or the list has run out, the box's first button is pressed.
Running and the replay
Click Run ①. The steps go to the engine, which runs them against the layout and sends back everything that happened. The page then replays it on the desktop:
- Each step plays as its own beat, with the step highlighted in the list. Waits play in the run's own time.
- Play / Pause, Step (to the next beat), Replay, a Speed from 0.5× to 4×, and Back to layout. Changing the layout or the steps also ends the replay.
- During the replay, a line under the desktop shows what the clipboard holds at that moment. A message box the run showed is drawn on the main screen with the pressed button lit.
- Anything the steps wrote to the log appears under Printed output.
- At the end the page says The run finished., or which step failed and why. In Script, it names the line instead.
A run stops early, with a message, when it:
- uses a builtin that would reach outside the sandbox, such as files, other programs, plugins, snippets or the power and sign-out builtins (not available in the sandbox);
- runs more than 200,000 instructions, records more than 2,000 events, or reaches 10 minutes of its own time (for example a loop that never ends);
- is longer than 8,000 characters (it doesn't run at all).
A compile error, or no answer from the engine, is shown without a replay.
What the sandbox doesn't simulate
The sandbox only pretends, and real programs can behave differently:
- Focus rules, the controls inside windows, and programs running as administrator are not simulated.
- A stand-in has no selection, so a copy key combination copies nothing. Typing and pasting add text to the active stand-in.
- A minimized stand-in reports the position Windows gives minimized windows.
- A pretend screen's device path is made up, so a step that names a real monitor's device path finds nothing. Its friendly name does match.
Taking the steps with you
- Copy steps (Copy script in Script) copies what runs to the clipboard.
- Save as snippet makes a snippet from it, as Steps or Script, and opens it on the Snippets page (Snippets). From there, an action can call it, or you can copy the steps into an action.