STSTray is a solution that was designed to be used with any Windows application so long as it can read and write plain
text files. It works on all versions of Windows from
At its simplest, it is an application that allows you to display an icon in the Windows system tray.
But that's not all that it is able to do! Using the TrayScript scripting language it can also:
STSTray uses scripts to tell it what to do, how to look, and how to act. The scripting language, TrayScript
is very similar to languages in products such as HyperCard, SuperCard, ToolBook, MetaCard, etc.). The TrayScript
language has only a handful of commands and events. Luckily, this handful will accommodate most people's needs.
TrayScript is divided into two main pieces - commands that cause actions to occur, and event handlers (ÒhandlersÓ)
that are triggered when an event occurs, and in turn execute one or more commands.
Icon/Notification Commands and Handlers |
set [the] icon to <iconPath> |
This command changes the icon displayed in the tray. |
flash icon <iconPath> [every <num> [milliseconds|ms]] |
This flashes the icon in the tray based on a user-defined interval. |
show [{info[rmation]|warning|error] balloon with <text> titled <title> |
This command displays a notification balloon under Windows XP. |
swap icon[s] <mainIconPath> {and|with} <swapIconPath> [every <num> [milliseconds|ms]] |
This command animates the icon in the tray, swapping back and forth between two icons. |
stop {flashing|swapping} |
This command causes the icon in the tray to stop flashing or swapping, returning it to its
original icon. (New in 2.0) |
on altShowBalloon |
This handler is executed whenever STSTray is supposed to display a balloon (done via the
show balloon command) but the current operating system is not Windows XP or greater.
(New in 2.0) |
on balloonClick |
This handler is executed whenever the user clicks on a balloon that was displayed with the
show balloon command, anywhere but on the close box of the balloon.
(New in 2.0) |
on balloonClose |
This handler is executed whenever the user clicks the close box of a balloon displayed with
the show balloon command.
(New in 2.0) |
on balloonShow |
This handler is executed whenever the balloon is displayed with the show balloon command.
(New in 2.0) |
Menu Commands and Handlers |
create menu <item1>,<item2>,...,<itemN> |
This command defines a menu to display when the user clicks on the tray icon. |
popup menu |
This command pops the menu up that you’ve created with create menu . |
install handler |
This command installs a new handler on the fly that installs a new handler in memory,
replacing any similarly-named handler so you can have dynamic handlers. (New in 2.0) |
on itemSelect |
This handler is triggered whenever a menu item is selected in a menu created with create menu |
Internet Commands |
check <url> [for updates] |
This command is used to automatically download and examine a script file from a
web server, and if it is newer than the last time it checked, it will execute the commands within that script file.
This is usually used to notify a number of users simultaneously of a product update, or other piece of information.
(New in 2.0) |
download <url> [to <filePath>] |
This command downloads a specified file from a web server to the local drive.
(New in 2.0) |
goURL <url> |
This command executes an internet URL ("http", "mailto", "ftp", etc.).
(New in 2.0) |
Miscellanous Commands |
answer [{info[rmation]|question|warning|error}] <text>
[with {"OK"|"OKCancel"|"YesNo"|"YesNoCancel"}] [titled <title>] |
This command displays an answer dialog and retrieves the user’s response. |
beep |
This command simply issues a beep sound. (New in 2.0) |
delete [file] <filePath> |
This command deletes a local file. (New in 2.0) |
launch <applicationPath> |
This command launches an application. |
quit (or exit) |
This command quits STSTray and removes its icon from the tray. |
set [the] outputFile to <filePath> |
This command changes the location of where output is written. |
set [the] tooltip to <text> |
This command sets the tooltip that is displayed when the mouse passes over the tray icon. |
set [the] polling to <num> [{milliseconds|ms}] |
This command sets the frequency that STSTray looks for scripts to execute.
(New in 2.0) |
set [the] scriptID to <value> |
This command defines a unique identifier for a script file that is used by check for updates .
(New in 2.0) |
set [the] silentErrors to {true|false} |
This command determines whether errors generated by STSTray are displayed as alerts, written to
a log file, or handled in a custom way. (New in 2.0) |
set [the] timer {to|for} <num> [{ms|secs|mins|hrs}] |
This command sets up a countdown timer that will execute commands when the timer expires.
(New in 2.0) |
write <text> [to file <filePath>] |
This command writes text to a specified file path. |
Handlers |
on openScript |
This handler is executed whenever the STSTray script file is read. |
on leftClick (or click) |
This handler is executed whenever icon in the tray is clicked with the left mouse button. |
on leftClickOneTime (or clickOneTime) |
This handler is executed the first time a user clicks the icon in the system tray with
the left mouse button.
(New in 2.0) |
on rightClick |
This handler is executed whenever icon in the tray is clicked with the right mouse button. |
on rightClickOneTime |
This handler is executed the first time a user clicks the icon in the system tray with
the right mouse button.
(New in 2.0) |
on doubleLeftClick (or doubleClick) |
This handler is executed whenever icon in the tray is double-clicked with the left mouse button. |
on doubleLeftClickOneTime (or doubleClickOneTime) |
This handler is executed the first time a user double-clicks the icon in the system tray with
the left mouse button.
(New in 2.0) |
on doubleRightClick |
This handler is executed whenever icon in the tray is double-clicked with the right mouse button. |
on doubleRightClickOneTime |
This handler is executed the first time a user double-clicks the icon in the system tray with
the right mouse button.
(New in 2.0) |
on scriptError |
This handler provides a means of trapping script errors and taking action based on this, but only
if the silentErrors has been set to true (see set silentErrors ).
(New in 2.0) |
on timerEvent |
This handler holds a series of commands that will execute each time the timer that has been
set with set timer expires.
(New in 2.0) |