NOTE: This page describes Version 2.6.2 of Script Timer.
Contents
1: Action Data Files
2: Action Panels
3: Preferences Panel (Files and Folders)
4: Preferences Panel (Actions)
5: Status Monitor
1: Action Data Files
Script Timer actually consists of two different programs: Script Timer itself and the scheduling engine, a faceless background process that does the actual scheduling and execution of the scripts, workflows, or applications.
Your ‘to do’ lists of scheduled actions are stored in action data files. You use Script Timer to create and edit these files. The scheduling engine reads your ‘to do’ list and runs items from it at the appropriate times. Note that you only need to run Script Timer when you want to change your ‘to do’ list. Otherwise, the scheduling engine runs unobtrusively behind the scenes carrying out your actions.
You can have as many action data files as you want. For example, you might want a completely different schedule of actions for weekends or holiday periods. You can easily switch among different data files, either manually using the ‘Set As Current Data File’ command in the File menu, or automatically by scheduling an AppleScript script that employs a custom Apple event defined for the program. (Registered users will be provided with an AppleScript script for automatic data file switching that uses this custom Apple event.)
Figure 1a: The Script
Timer 2.6.2 Document Window
A Script Timer document window
contains two "panes". The upper pane lists the contents of
the Designated Items to Schedule Folder, which is the
recommended place to hold the scripts and applications (or
aliases to them) you schedule frequently. Then scheduling
an item is as simple as dragging it from the upper pane
onto the table of scheduled actions (your ‘to
do’ list) in the lower pane.
However, Script Timer is completely flexible. You can store
your scripts or applications wherever you prefer, and just
drag their icons from a Finder window onto the table of
scheduled actions.
Before dragging your item to schedule to the lower pane of
the document window, you select the tab for the kind of
action you want by clicking on the appropriate tab. There
are three types of actions:
• Time of Day Actions run at a specific time of the
day, week, month, or year,
• Repeating Actions repeat on a time interval from one
second to any number of weeks, and
• Triggered Actions run when certain events occur such
as when the computer enters or leaves an idle state,
just before or just after the computer sleeps, when you log
into or out of your account, or when a specified program
starts or stops.
In addition, there is a special, unique
type of action called a “dynamic
action”. Dynamic actions can be created
by AppleScript scripts you schedule, and added to your
list of scheduled actions. This powerful feature allows
your list of actions to be modified on the fly depending
the results of the execution of your scripts. For
example, you might want to schedule one of two actions
to run depending on the outcome of a scheduled script,
or you might want to schedule a script to run at a time
that can only be determined by the execution of another
action.
When you drop your item to schedule onto the lower pane,
the appropriate Action Panel (see below) will come up, depending on
which tabbed list of scheduled actions is frontmost.
Actions listed in a table can be sorted by columns by
clicking on a column header. They can also be rearranged or
copied to another document window or program by standard
drag and drop techniques.
The lower pane is flanked on the right by six buttons:
• The Start button is used to turn
the scheduling engine on and off.
• The New button provides an
alternate way to the drag and drop method to create a new
action to schedule.
• The Edit button brings up an
Action Panel for the action or actions
selected in an action table so that their properties can
be edited. Alternately, you can just double click on an
action to bring up the panel.
• The Remove button removes the
selected actions from an action table. You can also just
use the Delete key.
• The Clone button is used to
duplicate a selected item in an action table. It brings up
an Action Panel pre-filled with data from a selected action
that you can edit to make a new action.
• The Do Now button causes the
selected actions in an action table to be executed
immediately. This is a convenient way to test the
correctness of a script before scheduling it for some time
when you are absent from your computer. The results are
displayed in the Do Now Results window:
Figure 1b: The Do Now
Results Window
In the example in Figure 1b an action with a script called “Running Procs” was selected in the Repeating actions table and then the Do Now button was clicked. The Running Procs script, which comes with Script Timer, assembles a list of all active programs and returns this information, normally for inclusion in the Script Timer log file. In this case the returned data is displayed in the Do Now window.
Top of Page
2: Action Panels
An Action Panel is used to fill in the information required
for the scheduling engine to schedule and run actions.
Action panels appear whenever you want to create a new
action or edit an existing one. Each of the three action
types has a slightly different panel, reflecting the
different characteristics of the action type. An action
need not involve a script - it could launch an application
or Automator workflow, or open a document.
Figure 2a: Example of
an Action Panel for a Time of Day Action
The panel in Figure 2a is for a
Time of Day action. It shows the properties of an action
that schedules the Track Timer iTunes controller
script to play a random selection from an iTunes play
list called "Jazz Faves" every weekday at 6:00 PM.
The “Item Name”, the file path to the item
(script, application, workflow, or document) to be run or
opened, is automatically filled in when you create a new
action by dragging the item onto an action table.
Alternately you can type the file path directly, or use the
Choose button to show a standard Open File panel, allowing
you to select an item from anywhere on your computer.
The Parameters field allows you to pass information to
scripts and Automator workflows. For example, in Figure 2a
the playlist to play, the sound level, and the track to
play are being passed to the Track Timer script.
The radio buttons allow you to choose among four different
scheduling patterns, while the Start Time control allows
you to specify when in the day you want the action to be
carried out. You can also specify a "Late Start" time. An
action will run even if its normal Start Time has passed
when the scheduling engine starts up, provided the Late
Start time has not passed.
The Wait Time is the time in seconds that the scheduling
engine will wait for a script to run to completion before
looking for another action to execute. Waiting allows the
engine to receive data returned by a script for further
action.
There are three types of data a
script can return (the latter two being specific to
AppleScript):
1. Information for inclusion in the Script Timer log file,
which you can view in the program at any time.
2. A New Action Record, which the scheduling engine uses to
schedule a new action on the fly. This "dynamic
scheduling" feature lets your AppleScript script
both construct and schedule another action for a different
time depending on its own outcome.
3. Information to indicate whether or not you want the
application that was front most on the screen before the
action started to return to the front when it ends. Not
restoring the front most application allows a script to
start another application and have that application remain
frontmost.
Unchecking the Active checkbox allows you to create an
action and save it in the data file without it being put
into the list of actions to schedule. An action can be
turned on and off at will using this checkbox, or the
equivalent one in the Script Timer document window.
Action panels for the other action types are shown in
Figures 2b and 2c. Both types of actions have Start and
Stop times, allowing you to bracket the hours you want an
action to run. For example, you might want an action to
take place every hour between 9 AM and 5 PM, but not
outside those times.
Figure 2b: Example of
an Action Panel for a Repeating Action
The action shown in Figure 2b
schedules the script “Running Procs” to run
every hour between 9:00 AM and 5:30 PM. The Running Procs
script, which comes with Script Timer, assembles a list of
all active programs and sends this information to the
Script Timer log file. Thus the log file will contain an
hourly snapshot of which applications are running during
the day. Running Procs requires no user supplied data to
run; therefore the Parameters field is left blank. The Time
Interval can be set to any number of seconds, minutes,
hours, days, or weeks.
Figure 2c: Example of
an Action Panel for a Triggered Action
Figure 2c shows an action
that schedules the “SayIt” script that comes
with Script Timer to say the phrase “going to sleep
now” whenever the computer is about to go to sleep.
This particular action is very handy for laptops. When you
close the lid the computer will tell you when it is safe to
move it. In addition to “sleep”, seven other
events can trigger an action:
- just after the computer wakes up
- when the computer enters or leaves an idle state
- when you log in or out of your account, and
- when an application you specify launches or quits
Top of Page
3. Preferences Panel (Files and Folders)
The operation of Script Timer can be fine-tuned through its extensive set of preferences. The preferences are grouped into two panels, one dealing with the settings for files and folders, the scheduling engine, and the optional status monitor; the other with the default settings for the various types of actions.
Figure 3a: The Script
Timer Preferences Panel (Files and Folders)
The Files and Folders
Preferences panel shows the two main files and the folder
associated with the program. In addition, you can change
the behavior of the scheduling engine and optional status
monitor from this panel.
• Current Data
File: You can have many different data files,
but only the one showing here as the Current Data File
will be used by the scheduling engine. Having multiple
data files can be a convenient way to group actions. For
example, you might have a “Holiday” data
file with seasonally favorite play lists for Track Timer to play.
- Changing the currently active data file is accomplished by:
- choosing the new data file here using the Choose button or typing in its path,
- using the "Set As Current Data File" command in the File menu, or
- by scheduling an AppleScript script that uses the
custom "change data file" command built into Script
Timer. (A custom script using this command is supplied to
registered users.)
• The auto update feature causes a data file to be saved whenever you make a change in its document window. The scheduling engine won't notice any changes you make in the Current Data File's document window until the file is actually saved. If this feature is turned off you must explicitly save the file using the Save command in the File menu. (Turning it off is sometimes convenient - for example when you are making a number of changes to the document window all at once.)
• Designated Items to Schedule Folder: This is a convenient place to hold frequently scheduled items. You can change it here in the Preferences panel, or by dragging a different folder onto the upper pane of any Script Timer document window.
• Log File: Script Timer maintains a log file that records the scheduling engine’s activities, such as when your actions are run.
Your scripts can also use the file to store their results. This lets you write simpler, more task oriented scripts by removing the need to include file access commands.
• Verbose logging increases the amount of information the scheduling engine records about its operations in the log file.
You would normally want to arrange for the scheduling engine to automatically start when you log into your account. You do this by checking the "Start at Login" checkbox. If you want to start the scheduling engine manually at some time after login you would uncheck this box. Note that no actions will take place unless the scheduling engine is running.,
The "Status Monitor Enabled" checkbox determines whether or not the optional status monitor is active. If active it will automatically start at login, and will keep running until you stop it or log out. The status monitor displays the scheduling engine icon in the system status bar to the right of the main menu bar. The icon is faded if the scheduling engine is not running, allowing you to ascertain its state at a glance. A menu attached to the icon allows you to open Script Timer, turn the scheduling engine on or off, or quit the status monitor.
The "Start or Stop Status Monitor" button allows you to turn the status monitor on or off at will.
If the "If on line check for new program version on Internet" option is selected, Script Timer will automatically check for newer versions of itself on the Apps & More web site when you launch it if the Internet is reachable, and alert you that a new version is available. (If you normally connect to the Internet via dialup modem, the Internet is not considered reachable unless you are actively connected.)
NOTE: During version checking no data is sent to the Apps & More web site from the computer running Script Timer, so your security and privacy are not compromised. Automatic version checking is included because with the increasing level of spam on the Internet and the consequent increase in email filtering, it is becoming more difficult for software vendors to communicate with their customers. The danger of a mass mailout about the availability of a new version being filtered away is high. This feature makes it easier for the user to keep up to date with the latest version of the program.
The Factory button resets the preferences to those that come with the program.
Top of Page
4. Preferences Panel (Actions)
You can assign default values to most of the properties of a newly created action, including the action type. Some properties are common to all actions, and some specific to each action type. Figure 4a shows typical default settings for Time of Day actions. The Actions preferences panels for Repeating and Triggered actions are shown in Figures 4b and 4c, and their differences are discussed below these figures.
Figure 4a: The Script
Timer Preferences Panel (Time of Day Actions)
The default action type
specifies which action table will be frontmost when you
launch Script Timer or open a new document window. You
would normally leave “New Actions are active”
checked. Otherwise you would need to explicitly activate
your newly created actions for them to be scheduled to run.
The tabbed panel in the center allows you to specify
defaults for the various properties in the action panel that appears when you create
a new action. Each of the three action types has its own
tab. Figure 4a shows a typical setup for a Time of Day
action, Figure 4b for Repeating action, and
Figure 4c for a Triggered action.
The Wait Time is the number of seconds the Script Timer
scheduling engine will wait for a script to complete before
continuing on. Waiting allows a script to return data to the scheduling engine for
further action or for saving in the log file. (NOTE: The
Wait Time only applies to shell and perl scripts,
AppleScript scripts that address other applications with
a 'tell' statement, and Automator workflows.)
If you check “Use Seconds in Times”, all time
displays in Script Timer will include seconds as well as
hours and minutes. This allows you to specify when you want
your actions to run with finer than one minute precision,
which might be handy if, for example, you are using Script
Timer, Track Timer, and iTunes to run
an Internet radio station.
You can decide whether or not you want the application that
was frontmost before an action started to be restored to
the front on your screen after the action completes. You
can override this preference on a script by script basis.
You would leave this option unchecked if, for example, a
purpose of your script was to bring forward or launch some
application.
If your computer is asleep, no programs are running. You
can choose to have any actions that were missed during
sleep to be carried out when the computer awakes or to be
discarded. For example, you would not want a script that
chimed the hour to run upon awakening. (If a repeating
action is missed more than once while the computer is
asleep, it is only carried out one time if this option is
selected.)
The scheduling engine checks for new actions to execute
every "Checking Interval" seconds. The checking interval
can be a little as one second, though you would probably
only use such a short time in special cases such as when
combining Script Timer, Track Timer, and iTunes to run
an Internet radio station.
Actions normally start on or near the start of a checking
interval. However, the program allows you to change this to
any number of seconds into the checking interval. For
example, if you had the checking interval set to 60
seconds, actions would start at the "top of the minute" for
a zero offset. The Scheduling Offset would allow you to
delay the start of actions to any number of seconds into
the minute.
The logout actions scheduled for your account will only run
when you log out if the "Enable Logout Actions for this
computer" checkbox is checked. Logout actions are enabled
on a computer-wide basis, so if this box is unchecked no
account's logout actions will run when that account logs
out. For this reason you need Administrator privileges in
order to change this setting.
Top of Page
Figure 4b: The Script
Timer Preferences Panel (Repeating Actions)
The preferences panel shown in Figure 4b differs from that in Figure 4a only in which tab is showing in the middle of the panel. You use the Time Interval field to set the default repeating interval for new Repeating actions, which can be from any number of seconds to any number of weeks. You can also specify the length of time after the start time you specify in the Action panel that the Repeating action will end. For example, if you set this figure at 8 hours, and you create an action that starts at 9:00 AM, the stop time will automatically be filled in as 5:00 PM, and the action will not take place after that time.
Figure 4c: The Script
Timer Preferences Panel (Triggered Actions)
The preferences panel shown in Figure 4c differs from that in Figure 4a only in which tab is showing in the middle of the panel. In this tab you can set a default trigger event for new Triggered actions by choosing one of the eight options in the Start Action At popup menu. As for Repeating actions, you can also specify the length of time after the start time you specify in the Action panel that the Triggered action will no longer fire.
Top of Page
5. Status Monitor
An optional status
monitor program comes with Script Timer. The status monitor
displays the scheduling engine icon in the system status
bar to the right of the main menu bar. The icon is faded if
the scheduling engine is not running, allowing you to
ascertain its state at a glance. A menu attached to the
icon allows you to open Script Timer, turn the scheduling
engine on or off, or quit the status monitor. Using the
status monitor means that you can easily access Script
Timer without having to take up valuable Dock space with
its icon.
Figure 5: The Status
Monitor Icon and Menu