The Steps engine
An action whose engine is Steps is a TOML list of [[steps]] tables instead of text. It calls the
same builtins and follows the same value and truthiness rules. The differences:
-
Each step has a unique integer
idand anop:call(fn,args),set(localplus avalue, or acall = { fn, args }),if,goto,end,repeat/end_repeat,exit_repeat,else/end_if. -
An
ifeither jumps by id (then_goto/else_goto) or, without those, opens a block closed byend_if. -
repeattakes exactly one oftimes,whileoruntil. -
A condition is exactly one of: a builtin call (
fn/args),value(truthiness), orcompare("==","!=","<","<=",">",">=") withleft/right. Addnot = trueto invert it. -
A string argument starting with
$reads a variable ("$target"). Everything else is a literal whose kind is its TOML kind, and that kind must match the parameter exactly, as in Script. -
{ const = "VirtualKey.MediaPlayPause" }is a named constant, replaced by its number when the steps compile, as in Script. A plain string spelled like one, such as"VirtualKey.F5", stays text. -
{ fn = "MouseGetCursorX" }, a table holding onlyfn, is the result of a builtin that takes no arguments. It is accepted wherever a value is:- a call's
args:args = [{ fn = "WindowGetActive" }] - a condition's
left/right:left = { fn = "ContextGetPointCount" }, right = 20 - a condition's
value:value = { fn = "EngineIsSafeMode" } - a
repeat'stimes:times = { fn = "FolderWatchGetCount" } - a
setstep'svalue:value = { fn = "UtilityGetTickCount" }
It takes no
args. For a builtin that needs arguments,setits result into a variable first and pass"$name". - a call's
-
There are no operator expressions. Arithmetic and string building need a Script action.
[[steps]]
id = 1
op = "set"
local = "target"
call = { fn = "WindowGetActive", args = [] }
[[steps]]
id = 2
op = "if"
condition = { fn = "WindowContainsTitle", args = ["$target", "Notepad"] }
[[steps]]
id = 3
op = "call"
fn = "WindowMaximize"
args = ["$target"]
[[steps]]
id = 4
op = "end_if"