Documentation

Editing commands

Adding commands#

Click + Add command (or right-click the command list and use its add menu). Commands are grouped by category: Keyboard, Mouse, Timing, Logic and loops, Routines, Variables, Alerts, Windows, Screen, Monitors, Programs and Other. Commands from plugins appear in their own category.

The new command is inserted below the selected line. Adding an If also adds its End If, and adding a Loop also adds its End Loop; put your commands between them.

The + Add command menu, with the Mouse category open.
The + Add command menu, with the Mouse category open.

Changing a command's settings#

Click a command. Its settings appear in Command settings on the right, with a short explanation of what it does. Changes apply straight away.

Most commands also have Delay before (ms) and Delay after (ms), which wait that long before or after the command runs. (End If, Else, End Loop, Label and Comment do not.)

Some boxes turn red when what you typed is not valid, for example letters in a box that needs a whole number.

The settings of a Click Mouse command.
The settings of a Click Mouse command.

Picking positions, areas and colours#

Commands that need a place on screen have picker buttons. The MacroFoundry window hides while you pick.

  • Pick position on screen: click the spot you want. For positions relative to a window, and for Click in Window, the position is measured from the inside top-left corner of that window, so the window must be open.
  • Pick area: drag a box around the area to search.
  • Pick color: click a pixel to copy its colour.
  • Capture image: drag a box around the thing you want Find Image to look for. It is saved as a PNG in an Images folder next to your project file (or in Documents\MacroFoundry Images if the project has not been saved yet).

Selecting, moving, copying and undo#

  • Hold Ctrl or Shift to select several lines.
  • Move up / down: the arrow buttons, or Ctrl+Up / Ctrl+Down. You can also drag lines to a new place.
  • Copy (Ctrl+C), Cut (Ctrl+X), Paste (Ctrl+V), Duplicate (Ctrl+D), Delete (Del) work on the selected lines. You can paste into another routine.
  • Undo (Ctrl+Z) and Redo (Ctrl+Y) work per routine.

The same actions are in the Edit menu and in the right-click menu of the command list.

Problems shown under the list#

If the routine's structure is wrong, a red Problem message appears under the command list, for example "End If has no matching If above it." A routine with a problem like this will not start until it is fixed.

An End If that was moved above its If. The red message says which line is wrong.
An End If that was moved above its If. The red message says which line is wrong.