Blocks the script thread for the specified duration.
Duration to sleep in milliseconds.
Hotkey, hotstring, and window-activation callbacks continue to fire during sleep — the event loop remains active on the blocking thread.
System.Sleep(500); // pause for half a second Copy
System.Sleep(500); // pause for half a second
Reads the current text content of the system clipboard. Returns an empty string if no text is available.
Returns "" (empty string) — never null — when the clipboard holds no text or holds non-text content such as an image.
""
null
const text = System.GetClipboard();if (text) Console.Log("Clipboard: " + text); Copy
const text = System.GetClipboard();if (text) Console.Log("Clipboard: " + text);
Writes text to the system clipboard, replacing its current content.
The text to place on the clipboard.
System.SetClipboard("Hello, world!"); Copy
System.SetClipboard("Hello, world!");
Encodes a UTF-8 string to its Base64 representation.
The plain text to encode.
The Base64-encoded string.
const b64 = System.Base64Encode("hello"); // "aGVsbG8=" Copy
const b64 = System.Base64Encode("hello"); // "aGVsbG8="
Decodes a Base64 string back to UTF-8 text.
The decoded plain text.
Throws a runtime error if the input is not valid Base64 or does not decode to valid UTF-8.
const plain = System.Base64Decode("aGVsbG8="); // "hello" Copy
const plain = System.Base64Decode("aGVsbG8="); // "hello"