When running or executing a script, SenseTalk performs the actions described by each statement in turn, from the first to the last, unless directed to do otherwise (such as by the flow control constructs as described in Flow Control). SenseTalk ignores blank lines. For supported commands and functions see Commands and Functions.
Parameters are values that are passed to commands or functions, that can then be used by the command or function to accomplish a desired action. The below examples show commands being called, with a number of parameters being passed to those commands. For more on parameters, see Parameters and Results.
put "Hello, World!" into greeting
wait 3 seconds
put "eggPlant says: " & greeting
add 5 to total
WaitFor 8.0, "HomeHeader"
A longer than usual SenseTalk statement may be continued to the next line by entering a “\” (backslash) character at the end of a line:
put "Hello! This is a simple contrived example " \
& "to show how long a statement " \
& "may be continued across several lines."
log each item of ("house","mouse","louse","pizza","grouse") \
whose length is 5 and which contains "ouse"
Comments are non-executing portions of your code that may be introduced into a script at any point to provide notes to the reader or developer of the script. Comments begin with -- (two dashes), // (two slashes), or # (a pound sign) and continue from there to the end of the line. Block comments, enclosed in (* and *) allow you to insert comments into the middle of a line, or to span multiple lines.
Author(s): Bob, Cindy, Janet
Last Updated: 5/25/2016
log each item of ("house","mouse","louse","pizza","grouse")\
(*whose length is 5 and*) which contains "ouse"
-- make the user think the computer is thinking hard!
if imageFound("Popup") then
LogWarning "undesired popup appeared" -- this relates to bug #2021
// let's change the greeting to French