DocsFlowSmart Desktop IF

Conditional Branching by Desktop UI Elements (Smart Desktop IF) in RunMacro

Desktop ModeRunMacro 3.5+

Smart Desktop IF is a conditional branching command in RunMacro that evaluates whether desktop controls exist, match text, are enabled, or are checked.

Dialog & quick setup

RunMacro Smart Desktop IF command configuration dialog showing parameter fields
Configuration dialog and parameter fields for the Smart Desktop IF command in RunMacro.
  1. In RunMacro, open the Flow › Smart Desktop IF command.
  2. Click 🎯 Pick Element and hover over the control to inspect.
  3. Choose the Condition: Element exists, Element not exists, Text contains, Text equals, Is enabled, or Is checked.
  4. If using a text condition, enter the target string in Condition Value (supports variables {var}).
  5. Select destination labels in If Label and optionally Else Label.
  6. Configure the Timeout (ms) probe duration (default 1500ms).
  7. Click Save to insert the condition into the workflow.

Options reference

🎯 Pick Element

Target picker overlay to capture UIA identifiers for conditional probing.

Condition

Evaluation mode: element_exists, element_not_exists, text_contains, text_equals, is_enabled, is_checked.

Condition Value

Comparison string when testing text_contains or text_equals conditions.

If Label

Target workflow Label jumped to immediately when the condition evaluates to True.

Else Label

Target Label jumped to if condition evaluates to False (leave empty to proceed to next command).

Modes & when to use

Desktop Mode

Probes UIA properties non-invasively without triggering mouse movement.

Best for

  • Checking whether a confirmation popup or error dialog appeared so the macro can dismiss or confirm it.
  • Verifying whether a 'Submit' or 'Save' button is currently clickable (Enabled) or grayed out (Disabled) before issuing clicks.
  • Branching execution when an order status label reads 'Completed' versus 'Pending'.
  • Checking whether a 'Tax Invoiced' checkbox is checked to avoid duplicate invoice issuance.

Use an alternative when

  • Evaluating web elements in browsers (use Smart HTML IF instead).
  • Pure variable comparisons unrelated to UI controls (use If Variable).
Before you run
  • Target desktop application is active on screen.
  • Workflow contains target Label anchors for branching.

Example workflow

Example: Auto-dismiss popup notice if present

  1. Add a Smart Desktop IF command.
  2. Pick the 'Dismiss' button or header of the announcement popup.
  3. Set condition to Element exists (element_exists) with 1000ms timeout.
  4. Set If Label to lbl_close_popup, and Else Label to lbl_continue.
  5. Under lbl_close_popup, place a Smart Click to dismiss the dialog.
Expected result: Execution flows immediately to the appropriate label based on live control state.

Tips & limitations

For transient popup checks, set timeout between 1000–2000ms to allow sufficient time for window rendering.
Avoid excessively large timeouts (>10s) on elements that are rarely present to prevent pipeline delays.
  • Apps elevated with Administrator rights require RunMacro to run elevated as well.

Applies to RunMacro 3.5+ · Desktop Mode · Windows 10/11

RunMacro robot

Robots do the work. Your time is yours.

Create a robot in minutes, no coding needed. Reliable execution, remote management, transparent costs — and you always stay in control.