Posted by Kyle Hankinson August 4th, 2022

General functions


The command function will process a command as if the user had typed it into the console. Any aliases in the command will be processed as well.


The wait function will cause the current script to delay for timeout seconds before continuing the script. The wait timeout can contain miliseconds by specifying decials.


The log function will append the specific message to the console. This can be useful when debugging scripts.


The processForAutocomplete method adds entries to the interal autocomplete list. entries can either be an array of strings, or a string which will be delimited by whitespace.


The commandAndReadFromServer will process a command as if the user had typed it into the console, then will read from the server until the next data stream has finished.


The beep function will cause your device to output a beep sound effect.



Variable functions are unrelated to javascript functions. Rather they are a way to store variables over multiple scripts. Regular javascript variables are removed from memory once the funcion has completed. All varaible methods below should have variable names passed as a string.


The isEmpty method returns true if a variable is unset or empty. A string variable is considered empty if it has zero length or is completely whitespace. A numeric variable is never empty (zero is not considered empty). Use the unset function to completely unset a variable.


The unset function is used to completely clear a variable.

setVar(variableName, value)


Returns the current value of the specific variable.

macOS specfiic functions


The status function updates the status bar to show the value for display.


The notify function will add a macOS notification with the specific message.


The badge method updates the app icon badge to show the specific display. This should be limited to a short string (less than 10 characters), or it will be truncated. Current/max HP is an example of what one might display in the badge.

Tags: General