Skip to main content

Cheat sheet

// Comments: line comments like this, or /* block comments */
count = 0; // a variable is created by assigning to it
name = "Notepad"; // Text (double quotes only)
ratio = 0.5; // Real
mask = 0x10 | 0x01; // hex literals + bitwise operators
on = true; // Bool
w = WindowGetActive(); // Window handle returned by a builtin

if (WindowContainsTitle(w, name)) {
WindowMaximize(w);
} else if (count > 3) {
UtilityPrint("many");
} else {
UtilityPrint("few");
}

for (i = 0; i < 5; i = i + 1) { // the only loop form
count = count + i;
}

UtilityPrint(StringFormat("count={0}, ratio={1}", count, ratio)); // count=10, ratio=0.500000
KeyboardPressKey(VirtualKey.MediaPlayPause); // named constant