2.0.1
Demo: Free
Licensed: $19.95

Minimum Requirements
Download
Buy Now
What is STSTray?
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 Windows 95 to Windows Vista.

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:

  • Display a menu when the user clicks on the icon, and take actions when the user selects an item from the menu, including communicating back to Revolution what the user selected
  • Display a tooltip when the mouse passes over the icon
  • Display a notification balloon under Windows XP and Windows Vista
  • Flash the icon at a user-settable time interval
  • Switch back and forth between two icons at a user-settable time interval
  • Display an "answer" dialog box with different settings, and capture the selection made by the user to pass back to another application
  • Write a file to disk
  • Launch a program with optional parameters (Enhanced in 2.0!)

  • Check a web server and notify users when updates to your product is available (New in 2.0!)

  • Prepare an email in your local email program (New in 2.0!)

  • Open a web browser and go to a specific web site (New in 2.0!)

  • Download files from the Internet (New in 2.0!)

  • Perform actions based on a timed interval, either once, or every X period of time (New in 2.0!)

  • Perform actions on trapped events in one of two ways: once only, or every time the event occurs (New in 2.0!)

  • Dynamically install menu handlers on the fly (New in 2.0!)

  • Delete a file from disk (New in 2.0!)

  • Icons can be GIFs, JPEGs, or ICO files, and will automatically scale to fit the system tray

What is It Used For?

Here are a few scenarios where this utility can come in handy:

  • To Let Everyone Know When a New Product Update is Available: You have distributed STSTray to your customers along with your product. When an update to your product is available, you simply update a single file on your web server, and then everyone gets notified via STSTray (perhaps a balloon or alert box, which when clicked would go to the web and see your info on the updated product).

  • For Notification: You have a program that acts like a background process and needs to notify the user when the job is done. It could flash the icon in the tray, and when the user clicked on it, it could display a custom message.

  • As a Reminder: Your program creates scheduled events, and you want to remind your user when something is scheduled to occur. It could show a balloon or flash the icon in the tray, and when the user clicked on it, it could display a custom message.

  • As a Launcher: You want to give your users a nice way to launch your program, or to set certain preferences. You could install an icon in their tray, and they could click and display a menu allowing them to launch your program or display a message.

How It Works

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.

The TrayScript Language

TrayScript contains the following commands and handlers:

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)

Demo vs. Licensed Versions
The Demo Version is fully featured; the only difference is that a dialog box is displayed when the STSTray application is launched, and a reminder dialog box is displayed periodically while STSTray is running in the system tray. When you purchase a Licensed Version, you are sent a replacement application that does not display these dialogs. All of your previously defined scripts will be fully usable.

The Licensed Version cost is per developer seat, with unlimited deployment in unlimited products! So what do you have to lose?

Example Script
Here’s an example of a script which will install a custom icon, a custom menu, and include handlers for managing what to do when a menu item is chosen:

on openScript
  set the icon to "../icons/myicon.gif"
  create menu "Restore Application,Open Notepad,-,Preferences...,-Exit"
end openScript

on itemSelect
  case "Restore Application"
    write "RestoreIt" to file "wakeup.txt"
  case "Open Notepad"
    launch "c:\windows\notepad.exe"
  case "Preferences..."\
    write "OpenPrefs" to file "needprefs.txt"
end itemSelect
Final Note
If you have any questions, please send an email to ststray@sonsothunder.com. If you are interested in this product, you might want to check out the documentation.