Utilities

Utility Commands

Essential tools for timing, debugging, and multi-window management.


1. Timers

Execute a handler periodically or after a set interval. Useful for clocks, auto-refresh, or delayed actions.

timer

Interval

Runs every X milliseconds.

update

Repeat

Run once or loop forever.

App.xml
<!-- Repeating Timer (Clock) -->
<Timer 
    Name="clockTimer" 
    Interval="1000" 
    Handler="UpdateClock" 
    Repeat="true"/>

<!-- One-shot Timer (Delayed Action) -->
<Timer 
    Name="delayedAction" 
    Interval="5000" 
    Handler="CloseApp" 
    Repeat="false"/>
info
Tip: You can stop a timer programmatically using a plugin or by not recreating it. (In v3.1, a <StopTimer> command is planned).

2. Delay & Wait

Pause execution for a specific amount of time without freezing the UI. This uses a non-blocking wait mechanism.

<Handler Name="Sequence">
    <Set Target="status" Property="Text" Value="Step 1..."/>
    
    <!-- Wait for 1 second -->
    <Delay Milliseconds="1000"/>
    
    <Set Target="status" Property="Text" Value="Step 2..."/>
    
    <!-- Wait for 2 seconds -->
    <Delay Milliseconds="2000"/>
    
    <Set Target="status" Property="Text" Value="Done!"/>
</Handler>

3. Logging & Debugging

Print messages to the console or the DevTools log window. Essential for troubleshooting logic.

<!-- Print to Console -->
<Print Text="User clicked button"/>

<!-- Print Variable Value -->
<Print Text="Current count: {count}"/>

<!-- Structured Log (Visible in DevTools) -->
<Log Message="API request started" Level="Info"/>
<Log Message="Validation failed" Level="Error"/>
<Log Message="Variable x changed to {x}" Level="Debug"/>

4. Multi-Window

Open new windows from separate XML files. Each window runs in its own isolated engine instance but shares the process.

<Handler Name="OpenSettings">
    <NewWindow Source="Settings.xml" Name="SettingsWindow"/>
</Handler>

<Handler Name="CloseSettings">
    <Close Window="SettingsWindow"/>
</Handler>

<!-- Close Current Window -->
<Close/>

<!-- Exit Application -->
<Exit/>

5. System Commands

Interact with the OS shell (CMD). Useful for running scripts or external tools.

<!-- Run a command and ignore output -->
<Plugin Name="FilePlugin" Method="run" Params="calc.exe"/>

<!-- Run CMD command (v3.1 feature via Plugin) -->
<!-- Currently, use ManualC for advanced process control -->