ST_manual.htmlTEXTMSIEˇˇˇˇR˚∏nH»∏nH»ÅÅœR Script Timer Manual

1. Introduction

1.1 Overview
1.2 Requirements
1.3 Script Timer is Trialware
1.4 Contacting Apps & More Software Design
1.5 Version History

2. Using Script Timer

2.1 Setup
2.2 How It Works
2.3 Three Ways to Start the Program
2.4 Synchronous versus Asynchronous Scripts
2.5 The Data File
2.6 The Log File
2.7 Bailing Out
2.8 Operating Notes
2.9 Sample Scripts
2.10 If You Have Problems

3. How to Register

3.1 Submitting Your Registration and Registration Fee
3.2 Making Your Copy of Script Timer Permanent

4. Fine Print

Appendix A: Error Messages
Appendix B: Sample Parameterized Script
Appendix C: References
Appendix D: Downgrading AppleScript in OS 9.2.2

 

1. Introduction 

1.1 Overview - This manual describes version 1.2 of Script Timer, intended for use with Macintosh OS 9.2.1 and OS X. Script Timer is an easy to use background application that lets you schedule the execution of Open Scripting Architecture (OSA) based scripts, such as those created using AppleScript. It allows you to run your scripts at any time on a daily, weekly, weekdays only, monthly, or one time basis as well as at regular intervals ranging from minutes to weeks. Because Script Timer handles all of the scheduling details, you can write short, easy to follow task oriented scripts to perform such diverse tasks as performing file system maintenance at a specific time, reminding you of an upcoming appointment, or downloading one or more large files from the Internet overnight.

If you need more information on the AppleScript scripting language, please consult one of the references in Appendix C.

1.2 Requirements - Script Timer 1.2 will work on any Macintosh running OS X, or OS 9.2.1. If you are running System 7.5 through 9.1, there is a "classic" shareware version of Script Timer available. Please see Section 1.4 below. Note that Script Timer is NOT compatible with the version of AppleScript that ships with OS 9.2.2. Many scripters have reported problems with AppleScript in OS 9.2.2. If you are running OS 9.2.2 and wish to go back to previous the version of AppleScript, see Appendix D.

NOTE: Some features of Script Timer 1.2 are only available in Mac OS X. See Operating Note 11 for details.

1.3 Script Timer is Trialware - Script Timer is a trialware product. Unregistered copies of the program will cease to function 30 days after they are first run. This should be more than sufficient time to determine if the program is of value to you. (You will start receiving warning messages approximately 4 days prior to the expiry date.)

If you do find it useful, please consider paying the registration fee. The fee is US$10 for a single user, US$300 for a site license (equal to 30 users), or US$600 for a worldwide license for your organization. Recognized academic institutions may obtain a site license for US$100. Registered users of a previous version of Script Timer are eligible for a free upgrade to version 1.2. 

Upon registering you will be provided with a personalized registration code that will make your copy of the program permanent. (Note: You should save this registration code in case you need to reinstall Script Timer, and to register any free upgrades.) You will also receive two scripts designed to be run by Script Timer. One uses the popular Internet engine Interarchy to download files from the Internet, and the other can be used to automatically trim Script Timer's log file to contain only the most recent entries. (Thanks to Paul Berkowitz for providing the script that this latter script is based on.)

Please see "How to Register" below for further information on how to register your copy of the program.

Registered users are eligible to receive free technical support for Script Timer via email, and will be notified of any updates and news about the product.

1.4 Contacting Apps & More Software Design - We welcome your comments, questions, and criticisms. Please let us know if you have any suggestions for improvements to Script Timer, or if you have another application you would like to see developed that would make your life easier. You can contact us at: 

WWW: http://www.theboss.net/appsmore

email: appsmore@kagi.com
 

1.5 Version History 

2002 January 19 Version 1.2 Released (for Macintosh OS 9.2.1 and OS X 10.1.n)
2001 October 19 Version 1.1.1 Released (for Macintosh OS X 10.1)
2001 July 1 Version 1.1X Released (for Macintosh OS X 10.0)
2000 December 15 Version 1.01 Released (for Macintosh OS 7.5 thru 9.1)

2. Using Script Timer

2.1 Setup - In OS X the Script Timer 1.2 folder should be placed in your "Home" user folder. (NOTE: Apple Computer recommends that you create a folder called 'Applications' in your Home folder for your applications, but this is not strictly necessary.) In OS 9.2.1, Script Timer may reside anywhere on your system. However, it is a probably a good idea to keep it in the same folder as your other applications.

Unstuffing the distribution file and moving the folder to the preferred location is all there is to installing the program.

The first time you launch the program, you will be asked to locate a default folder containing the scripts that you want to schedule to run. If you don't want to use the "Scripts to Schedule" folder contained in the Script Timer 1.2 folder, you can choose or create a different one. This should be done BEFORE you start the program for the first time. Scripts you want to schedule need not reside in this default folder; however, it is strongly recommended that you put them there. See Operating Note 6. The "Scripts to Schedule" folder already contains several useful sample scripts for you to schedule with the program.

To create a new folder:

OS X:
- open a Finder window for the folder in which you wish to place it by double clicking on that folder
- select New Folder from the File Menu of the Finder, or type command-shift-N
- type in a name for your new folder, such as "Script Timer Scripts", and hit Return.

OS 9.2.1:
- open a window for the folder in which you wish to place it by double clicking on that folder
- select New Folder from the File Menu of the Finder, or type command-N
- type in a name for your new folder, such as "Script Timer Scripts", and hit Return.

When you launch Script Timer and see the Choose Folder dialog, navigate to the folder that you want to contain your scripts to schedule and choose it. You will also see the Choose Folder dialog on program start up if you move or rename your scripts folder at a later time. This gives you the opportunity to change the scripts folder.

Script Timer is intended to run in the background as long as you are logged in to your computer, so you should arrange to have it start automatically whenever you log in. Just be sure to manually start the program at least once so that you can designate your default scripts folder. Otherwise, program will be halted until you locate this folder. If Script Timer is in the background, you may not be able to see the Choose Folder dialog and not realize the program is not running properly.

OS X:
To make Script Timer a Login Item:

1) Choose "System Preferences" under the Apple Menu.
2) Click on the Login icon.
3) In the Login Items panel, click on the Add button, navigate to the Script Timer application, and choose it.
4) Click in the Hide check box in the Login Items panel to hide Script Timer after it has started. Its icon will still appear in the Dock.

Script Timer will now start running automatically whenever you log in.

OS 9.2.1:
Make an alias of the program and place it in the Startup Items folder in your System folder.

To make an alias, select the Script Timer icon in the Finder, and choose "Make alias" from the File menu, or type command-M. Then drag the alias icon onto the Startup Items folder in the System Folder.

NOTE: Script Timer cannot initiate the execution of scripts while your computer is asleep. See Operating Note 1 below for an explanation of how to prevent your computer from sleeping.

 

2.2 How It Works -Whenever Script Timer is launched, it looks for a plain text file referred to as "the data file" (see below), initially in the same folder as itself. You tell the program what scripts you wish to run, which days or time intervals you want the scripts to be run, and the time of day you want the runs to start, by entering the information into this file. You can also specify whether you want scripts to be launched "asynchronously" (i.e. launched and forgotten), or "synchronously" (have Script Timer wait for their completion). In OS X you can specify how long you want Script Timer to wait for a synchronously launched script to complete before carrying on. (In OS 9.2.1, the program always waits for such a script to complete. See Operating Note 11 below for further details.)

Script Timer creates an internal list of script items (the "script list") from this information. Every day at midnight if it is running, when it is launched, or whenever the data file is modified or a new data file has been chosen, Script Timer takes the information in the script list and creates a list of script runs for the rest of the day (the "daily run list"). As it runs in the background, Script Timer periodically monitors the system time, and, when a run time has passed, it executes the scheduled script.

You can schedule either compiled scripts or script applets (mini applications). Normally, applets will appear in the Dock in OS X; however, when launched by Script Timer, they, like compiled scripts, will not appear in the Dock unless they are launched asynchronously. The asynchronous launch feature, intended to allow the launch of stay open applets, has the side effect that you can directly launch any program or open any document for which you have the correct privileges.

Whenever Script Timer detects that it is time to launch something, it remembers what the current frontmost application is, and then it does the launch. Upon return from the launching action, it restores the previously frontmost application. This means that asynchronously launched items will be in the background.

When the program prepares its daily run list, run times prior to the start up time of the program are discarded. This is so that if you restart Script Timer in the middle of the day, you will not get an unwanted script execution (possibly a duplicate) starting as the program realizes a run time from earlier in the day has already passed. The exception to this behavior is in the case of one time runs (discussed below). In this case, if the specified run time has already passed when Script Timer is started, the script run will be scheduled for the next day at that time. Otherwise, the requested action would never be carried out.

NOTE: If your copy of the program is not registered, you will begin to see warning messages that it is about to expire approximately 4 days before the expiry date. These will appear both on the screen and in the log file every time you start the program or change the data file by Drag and Drop (see below), and every night at midnight if the program is running. The warning message gives you the opportunity to immediately obtain a registration code. Just click on the "Get Code Now" button. A second dialog appears, informing you that your web browser is about to launch. If you click the "OK" button, your browser will take you to the Apps & More registration page at kagi.com. The registration procedure is discussed below in Section 3.2, Making Your Copy of Script Timer Permanent.

Because the screen warning message might appear when no one is present, it will disappear after 30 seconds if no button is clicked. The message will still appear in the log file.

Note that even if your trial period has expired you will still be able to register your copy of Script Timer, although you will not be able to do anything else with the program.

2.3 Three Ways to Start the Program

1. Automatic Start on Log In - As discussed in Setup above, this is the usual way to start the program. Just make the program a Login Item( OS X) or a Startup Item (OS 9.2.1). The program will start up as part of your log in sequence and continue to run in the background, monitoring for the passage of run times and executing scripts.

2. Double Click on Program Icon - If you don't want the program to be running all the time, or if you have had to terminate it for some reason, you can simply start it as you would any other application. It will then continue to run in the background as discussed above.

3. Drag and Drop - You can drag and drop the icon of a valid data file (see below) located anywhere on your system where you have the appropriate privileges onto the Script Timer icon, and this will start the program, using that data file to build the master script list and making it the default data file. To perform a drag and drop, click on the file icon and while keeping the mouse button depressed, drag the icon over top of the Script Timer icon. Release the mouse button when the Script Timer icon highlights. Note that if you drag and drop a valid data file onto the Script Timer icon while the program is running, that file will become the new data file, and a new script list and daily run list will be created. In OS X this applies to both the icon in a Finder window and the icon in the Dock.

If your copy of the program is not registered, you will see the registration dialog every time you use drag and drop onto the Script Timer icon. You are not required to register to continue, just click on the "Not Yet" button. When you have obtained a valid registration code, you enter it in the registration dialog and click on the "Validate" button. See Section 3.2, Making Your Copy of Script Timer Permanent, below for more details.

2.4 Synchronous versus Asynchronous Scripts

There are two ways to run scripts using Script Timer: synchronously and asynchronously. You indicate which mode you want a script to run in using the "wait time" field of the data file.

In the case of synchronous scripts, Script Timer will wait for the script to complete. If the script has not returned by the time the user specified wait time has expired the script will be allowed to carry on, but a warning message will be written to the log file and then Script Timer will also proceed, possibly starting another script if a run time passes. (In OS 9.2.1 Script Timer always waits for script completion; the wait time is ignored.) Waiting for the script to complete allows it to return data to Script Timer to write to the log file (unless the wait time has expired before script completion). This means that if you need your script to save some data, you can use Script Timer's log file, eliminating the need for the script to create and write to its own file. You can also pass data to a synchronous script for use in its processing.

In the case of asynchronous script launch, indicated by specifying a wait time of zero seconds, Script Timer just launches the script and carries on. This allows you to launch stay open script applets that do not simply run and quit, but continue to execute periodically via an "idle handler". (Please consult one of the references in Appendix C for more information on stay open applets.) Once launched asynchronously, a script applet is an independent process, so it cannot return data to be logged by Script Timer. Also, you cannot pass data to an asynchronously launched script applet.

Note: Script Timer does an asynchronous launch by sending the Finder an "open" message with the script as the object of the message. This means that as well as launching script applets with Script Timer, you can directly launch any application, or open any document for which you have the proper privileges. This also means that you cannot run compiled scripts asynchronously. The Finder considers them to be documents, and so will open them in whatever editor created them (usually Script Editor).

To use Script Timer to launch applications or open documents, you should put an alias of the application or document in your scripts folder and use its name in the data file instead of a script name. (Of course you could also put the item directly into your scripts folder if you wanted - this is definitely not recommended for applications, which should remain where they were installed, especially in OS X.) To make an alias to an application or document in OS X, click on the item's icon in a Finder window and select "Make Alias" from the File menu or type command-L. The operation is similar in OS 9.2.1, but the keyboard short cut is command-M.

The following summarizes the difference between synchronous and asynchronous script launching:

Synchronous Launch

Asynchronous Launch

  • Script Timer waits for script to complete
  • Launched item uncoupled from Script Timer
  • Can launch compiled scripts and script applets
  • Cannot launch compiled scripts
  • Can only launch scripts
  • Can launch any application or open any document as well as script applets if have proper privileges
  • Can pass data parameters to the script
  • Cannot pass data to the script
  • Can return data to be logged by Script Timer
  • Cannot return data to be logged by Script Timer

  2.5 The Data File - Since Script Timer is meant to be run unobtrusively in the background, it has a very simple user interface. You enter your script scheduling information into a plain text file, using for example the TextEdit application that comes with all Macintosh computers running OS X. (See Operating Note 9 for a cautionary note on the use of TextEdit.) The text editor may use either a 'return' or 'line feed' character as a line terminator, but it must produce a plain text file. (The default for TextEdit is to output in Rich Text Format (RTF); you must explicitly specify plain text output.) In OS 9.2.1 it recommended that you use SimpleText for your data files.

When Script Timer is launched for the very first time, it looks for a file called "Script Timer data.txt" located in the same folder as the folder you specified to hold your scripts. This should be the name and location of your initial data file. (A data file of this name containing inactive examples already exists in the Script Timer folder.) If the program cannot find a file of this name, it will display a Choose File dialog and ask you to locate your data file. If you click on "Cancel" instead of making a choice, you will see the error message "The data file "Script Timer data.txt" was not found" and you will have no option but to quit the program. See the explanations of error messages in Appendix A for further discussion.

If you launch the program by dragging and dropping another valid data file onto its icon, you change the default data file to that file. Thereafter when the program is launched, it will look for the new data file. If this file cannot be found you will get the error message described in the previous paragraph, with only the name of the missing file being different.

You can also use drag and drop as described above while the program is running to change the master script list internal to the program. If you drag and drop a modified version of the current data file, the script list will be changed. If you drag and drop a different data file, the script list will be changed and that file will become the new default data file. In OS X you can drop the data file icon onto the Script Timer icon in the Dock as well as in a Finder window.

Whenever Script Timer is launched and every 30 seconds thereafter, it checks for any change to the data file, either a modification of the current data file, or a change of data file. If a change is detected, it reads the data stored in the modified or new data file and prepares an internal list of run items referred to as the script list. Otherwise, execution proceeds with the previously established script list. After starting or after creating a new script list, and daily at midnight if it is running, Script Timer prepares a run list for the day from the script list. The new run list will only include items for the day scheduled after its creation. Note that if you modify the data file too close to a scheduled run time, the run time may pass before Script Timer notices the change, and the item will be missed. Note also that after modifying the existing data file while Script Timer is running, you should stay at your computer for 30 seconds to make sure that the program has picked up the change and not found any errors in the file. Otherwise, it will be suspended until you acknowledge the error dialog generated. Changes made via drag and drop take place immediately, so if there is a problem with the data file in that case, you will know immediately.

Whenever Script Timer detects a formatting error in the data file, you will see an error message dialog and you will be forced to quit, correct the error, and restart the program. The modification date of the data file will be incremented by one second as the program quits to force a rebuild of the script list at the next program launch. Otherwise, if you did not correct the error before relaunching Script Timer, it would run without referring to the data file, and only that part of the script list created from data appearing in the data file before the error would be used.

Unregistered copies of Script Timer will display a Registration Dialog (see How to Register below) when you use drag and drop to start the program or change the data file. If you do not yet have your registration code, simply click on the "Not Yet" button to dismiss it. Once a valid registration code is entered in the dialog, it will not be seen again.

The format of a run item is straightforward: script name <tab>frequency<tab> time[<tab>wait time]

Each of the four fields must be separated by a single tab character (denoted by <tab> above), and there must be only one run item per line. The square brackets denote that the last field is optional and are NOT part of the data, so do not include them if your run item uses all four data fields. If there is more than one tab between each field, or a trailing tab, you will get an error. See Appendix A

Any line beginning with an exclamation mark (!) is ignored, so that you can include comments or notes, or temporarily exclude a run item from consideration. Blank lines are also ignored. There is no limit to the number of entries in a data file.

script name is the name of a script that you want to run. The name may contain spaces, and it may also be followed by an optional list of parameters separated by commas and enclosed in parentheses. These parameters are substituted one-for-one for items in the parameter list that ends the first line of the run handler of your script. See Appendix B for an example of a parameterized script. Note that scripts run asynchronously cannot use parameters.

When using Script Timer asynchronously, "script name" can be the name of any application or document for which you have the proper privileges to launch or open.

If a script is not located in your default scripts folder, then Script Timer will ask you to locate it on your system every time you change or modify the data file.

frequency specifies when you want the script to be run. There are two types of frequencies: specified time or time interval. At present, the specified time frequencies are: once, daily, weekdays, and the names of the days of the week. In addition, you can specify a given day of the month, or a given weekday each month. Recognized time intervals are any number of minutes, hours, days, and weeks.

once - The script will be run one time only. If the designated run time has already passed when Script Timer is launched, the script will be run on the following day at the designated time.

Note: After the script has run, Script Timer removes the item from its internal script list. However, the item is not removed from the data file. Therefore, if you make any change to the data file, the item will again be scheduled for execution. To prevent this, simply remove the item from the data file after the one time run has started, or tell Script Timer to ignore it by putting an exclamation mark in front of the script name in the file.

daily - The script will be run every day at the designated run time.

weekdays - The script will be run Monday through Friday at the designated run time.

day name - If the name of the day of the week appears in the frequency field, the script will be run at the designated run time on that day of the week only. Script Timer recognizes the words Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, and Saturday. Abbreviations are not allowed.

day n - The script will be run on the nth day of the month at the designated run time. If n is a negative number, the script will be run on the nth last day of the month. For example "day -1" indicates that the script is to be run on the last day of the month. If n is greater than the length of the month, an error will occur. Therefore, care must be taken if you specify a day greater than 28, the length of the shortest month. It is usually better (and more appropriate) to use a small negative value for n in this case.

nth weekday - The script will be run on the specified occurrence of the week day each month at the designated run time. The recognized ordinals are first, second, third, fourth, and last, and the recognized day names are those indicated above.

n time units - The script will be run repeatedly every time the specified number of time units has passed. n can be any positive number, and the recognized time units are minutes, hours, days, and weeks. Both singular and plural forms are recognized. For example, if you wanted to run a script that checked your e-mail every hour, the frequency would be "1 hour".

time is the time of day you want the script to run for specified time frequencies. For time intervals of less than 12 hours, it will be the time of day you want the first run of the script to start each day. For time intervals of 12 hours or more, it is the time you want the script to start on the first day (i.e. the day you last modified the data file). Depending on the frequency, the run times could be different each day. For example, for a frequency of 13 hours with a start time of 6 PM, the script would run at 6 PM on the day that the internal script list was changed (this only occurs when the data file is modified). Assuming the script list remained the same thereafter, on the next day the script would run at 7 AM and 8 PM, and on the day after that at 9 AM and 10 PM, and so on.

You may use either a 12 or 24 hour clock, separating the hours, minutes, and seconds (if included) by colons (:). If you use a 12 hour clock, you must include PM if you want the time to be between noon and midnight. You should also include AM for times between midnight and noon for clarity. (Note: it is necessary to include AM for times in the midnight hour (12:00 AM to 12:59 AM); without it they will be taken to be in the noon hour.) Putting a space between the time and AM or PM is optional. Note that Script Timer designates 12:00 AM as midnight. Midnight runs will be included in the daily run list of the previous day. See Item 3 in the "Operating Notes" section below for a discussion of midnight runs. Take care not to include characters other than numbers, the colon, or AM or PM in the time field or you will get an error. If you inadvertently trail the time with a space the time will look correct, but you will still get an error. Also make sure that you include no more than 2 digits in any of the hours, minutes, or seconds fields. The system date function used by Script Timer ignores leading zeroes, so if you type "10:055" by mistake, the time will be set to "10:55".

wait time is the number of seconds that you want Script Timer to wait for the scheduled script to complete. This field is optional, and in OS 9.2.1 the only meaningful value for it is zero. All other values will be ignored. In OS X, the wait time can be zero or any positive integer. If it is not specified, the wait time defaults to 60 seconds. If a nonzero wait time has passed before a script has finished, a warning message will be entered into the log file, and Script Timer will resume execution. The script will continue running, but will not be able to return any data to be logged by Script Timer.

Here are the contents of a sample data file (most script names are fictitious): 

! This is a comment line and will be ignored by Script Timer, as will the following blank line.

Reminder(Time to quit!)

weekdays

5:00 PM

MyDLScript

once

23:00

3600

Reminder(Time to go to bed)

daily

11:00 PM

MyBackupScript

Saturday

2:00 AM

0

!Reminder(Math class in 5 minutes)

daily

9:55AM

CheckMail

1 hour

8:30 AM

Defrag Script

day -1

11:00 PM

Payroll Script

2 weeks

6:00

Reminder(Staff Meeting in 10 minutes)

second Friday

3:50 PM

StayOpen Applet

daily

9:00 AM

0

My Application

day 15

12:00 PM

0

My Document

daily

4:25 PM

0

 

Explanation

Line 1: Use comment lines to annotate your data files by making an exclamation mark the first character in the line.

Line 2: Blank lines may be used to provide readability.

Line 3: This line will run a script called Reminder that takes a single parameter at five in the afternoon Monday through Friday. Note that the message should not be inside quotation marks unless you want those marks to be part of the parameter. See Appendix B for a discussion of parameterized scripts.

Line 4: This line will run a hypothetical script for downloading from the Internet starting at eleven o'clock in the evening once. Script Timer will wait 3600 seconds (1 hour) for it to complete before carrying on (0S X only). Note that unless the line is removed or disabled by putting an exclamation mark as its first character, this script will continue to be scheduled every time the Script Timer data file is modified.

Line 5: This line will run the Reminder script at eleven o'clock in the evening seven days a week. In this example file, on the day that MyDLScript is run, Reminder will not start until that script is completed (OS 9.2.1), or one hour passes and the script is not completed (OS X). If two run items are scheduled at the same time, as in lines 3 and 4, the one appearing first in the data file will start first.

Line 6: The script "MyBackupScript" will be run Saturdays only at 2 AM. This script will be launched asynchronously and Script Timer will immediately carry on. It must be a script applet, not simply a compiled script.

Line 7: An exclamation mark is used to temporarily disable a script from being run.

Line 8: Each day starting at 8:30 AM, the script "CheckMail" will be run every hour. If your computer is not running at 8:30 AM, the script will first run on the next scheduled time after it was started (9:30 AM, 10:30 AM, and so on.) If your computer remains on, the script will continue to be run every hour until 11:30 PM, the last scheduled run time for the day. A new set of scheduled runs will be created on the next day.

Line 9: The script "Defrag Script" will be run on the last day of every month at 11 PM. Note that spaces are allowed in the script name.

Line 10: The script "Payroll Script" will be run every two weeks, starting from the last date the Script Timer data file was modified, at 6 in the morning.

Line 11: The Reminder script will be run on the second Friday of every month at 3:50 PM.

Line 12: A stay open applet will start daily at 9:00 AM. Since the wait time is 0 (asynchronous launch), once this applet has started, Script Timer has no further connection to it.

Line 13: Directly open the application "My Application" at noon on the 15th day of the month.

Line 14: Open the document "My Document" every day at 4:25 PM. The document will open in the application that is designated to open it (usually the application that created it).

 

2.6 The Log File - If it does not already exist, a plain text file called "Script Timer log.txt" is automatically created in the same folder as the program whenever Script Timer is launched. This is referred to as the "log file" and provides a logging function for the program.

All error conditions are recorded in the log file. Error conditions that can be mitigated so as to keep the program running are simply noted in the file for later examination. Errors occurring during the launch of Script Timer or the changing of the data file that require user action to resolve also display a dialog on the screen. Such errors include a missing or empty data file, a format error in the data file, or a script named in the data file that cannot be found. Since Script Timer will not proceed until the dialog is dismissed, care must be taken when Script Timer has been designated as a Login or Startup Item as the log in procedure could be interrupted. See Operating Note 8 below.

A list of all error and other messages produced by Script Timer is given in Appendix A

The log file is also used to record successful actions taken by the program, such as the completion of a synchronous script execution. Synchronously run scripts can append data to Script Timer's completion message for inclusion in the log file by ending with the following statement:

return {Logging: <data>}

where <data> is any data that can be made into a text string. See the Sample Script "Running Procs" for an example of a script that returns data to Script Timer for logging, in that case being a list of running programs (see below). Being able to return data for the program to store means that your script does not have to bother with file handling if you need it to save some information. Note that asynchronously run scripts, and synchronously run scripts whose run times exceed the specified wait time cannot return any data to Script Timer. (The latter only applies to OS X, since in OS 9.2.1 the program always waits for synchronously run scripts to complete.)

You can examine the log file with any text editor such as TextEdit in OS X or SimpleText in OS 9.2.1 to see what scripts Script Timer has run, and what problems if any have occurred. In OS X if you double click on the file, it will open with TextEdit. (See Operating Note 9 for a note of caution about this, see Operating Note 10 if you want to change the default application.) In OS 9.2.1 double clicking will open the log file in SimpleText. (See Operational Note 11 for more information on the log file in OS 9.2.1.)

Note that the contents of the log file will continue to grow over time - you must use a text editor to clear any messages you no longer want to keep. In OS 9.2.1, the SimpleText program will not be able to open the file if it grows to exceed 32K in size. Registered users will receive an AppleScript called "Truncate Timer log" that they can schedule with Script Timer to do this automatically (see Section 1.3).

If Script Timer wants to log a new message while the log file is open in another program (your text editor for example), it may create a new log file called "Script Timer log#.txt" and write to that file. To keep all of your log messages together, you can copy the contents of the extra file to the original log file then delete the extra file. You may also delete or rename the original log file and rename the extra file to "Script Timer log.txt", making it the default log file. Once the original log file is closed, it will again be used for any new messages.

The following is a sample of the contents of a log file:

Saturday, 2001 December 15 5:54:33 PM: Script Timer 1.2 restarted.

Saturday, 2001 December 15 5:54:33 PM: Using existing script list from data file "OS X Volume:Users:Apps & More:shareware:Script Timer:Script Timer data.txt".

Saturday, 2001 December 15 5:54:34 PM: New run list with 5 items created.

Saturday, 2001 December 15 6:05:12 PM: Starting <test script> . (Run Number: 10)

Saturday, 2001 December15 6:06:13 PM: Warning! Execution time of <test script> exceeds 60 seconds. Script will be allowed to finish. (Run Number: 10)

Saturday, 2001 December 15 9:32:57 PM: Starting <Reminder(Check thermometer!)> . (Run Number: 11)

Saturday, 2001 December 15 9:33:01 PM: <Reminder> completed. (Run Number: 11)

Saturday, 2001 December 15 10:11:08 PM: Starting <Running Procs> . (Run Number: 12)

Saturday, 2001 December 15 10:11:13 PM: <Running Procs>completed. (Run Number: 12)
Script Timer 1.2,Internet Explorer,Outlook Express

Saturday, 2001 December 15 10:30:13 PM: Starting <Reminder(Check thermometer!)> . (Run Number: 13)

Saturday, 2001 December 15 10:30:15 PM: <Reminder>completed. (Run Number: 13)

Saturday, 2001 December 15 10:30:15 PM: Starting <Truncate Timer Log> . (Run Number: 14)

Saturday, 2001 December 15 10:30:16 PM: <Truncate Timer Log>completed. (Run Number: 14)

Sunday, 2001 December16 12:30:21 AM: Script Timer 1.2 terminated.

 

2.7 Bailing Out - If you need to quit Script Timer, just treat it like any other application. In OS X make it the front most application by clicking on its icon in the Dock, then choose Quit under the File menu or type command-Q. Alternately you can click on the icon in the Dock while holding down the Control key and choose Quit from the pop up menu that appears. In OS 9.2.1 you can bring the program to the front by choosing it in the Application Menu on the right hand side of the screen, then selecting Quit under the File menu or typing command-Q as above. A termination message will appear in your log file

If you wish to quit a synchronously running script already in progress, make Script Timer the front most application as described above. If the script has a user interface that allows you to quit it, an error message with error number -128 will appear in your log file and Script Timer will continue running. If the script has no facility for quitting, the only way to stop it will be to quit Script Timer. Asynchronously launched scripts or applications are independent of Script Timer. Quit them as you would any application.

2.8 Operating Notes

1. Obviously, your computer must be running for Script Timer to do its work. Unfortunately, as of this writing the Energy Saver System Preference does not allow you to automatically start up and shut down your machine in OS X at selected times as does the Energy Saver control panel in OS 9.2.1 and previous Macintosh operating systems. You must leave it running over the period you want your scripts to be run. Furthermore, scripts won't run if the computer is asleep, so you must also prevent your computer from sleeping. (Any missed script runs for a day will take place on wake up as will the creation of a new script list if midnight has passed. When the new script list is created, script run times prior to the run list creation time will be lost.)

To keep your computer from going to sleep in OS X:

1. Choose System Preferences from the Apple Menu.
2. Click on the Energy Saver icon.
3. Drag the slider under "Put system to sleep when it is inactive for" all the way to the right (Never).
4. Check "Separate Timing for Display Sleep" and select your desired time before the monitor darkens.
5. Check "Separate Timing for hard disk sleep" and select your desired time before the disk spins down.
6. Close the Energy Saver panel by clicking on the red Close control or the "Show All" icon.

In OS 9.2.1 you can use the Energy Saver control panel to schedule your computer to start up and shut down on its own. 

2. If you connect to the Internet via an external modem, make sure that it is powered on if you are running a script that downloads files. Otherwise whatever download program your script is controlling will not be able to connect to the Internet.

3. It may not be a good idea not to start a script run too close to midnight. At midnight, Script Timer creates a new list of run items for the new day from the master script list. (Note however, that a run scheduled for exactly 12:00 AM will be in the previous day's run list and will execute before the new run list is created.) If a synchronous script run is in progress at midnight, the new daily run list will not be created until the run is completed, which could be some time later. If run list creation starts after a scheduled run time, that script run will be skipped just as if you had restarted the program after that run time.

4. If the application you use to create the data file allows you to change the tab stops, you should make them far enough apart so that it is obvious if you accidentally attempt to separate fields in a run item with spaces instead of tabs. (Note: The data file must be a plain text file. TextEdit will not allow you to adjust tab stops for a plain text file.)

5. Script Timer prepares a new internal master script list every time you modify the data file or change which data file you want to use. A separate list entry is made for each interval when an interval frequency is chosen. It may take a considerable length of time for a large number of list entries to be created, and the program may appear to be hung during this time, depending on the speed of your computer. You should take this into consideration when specifying an interval frequency. For example, in the worst case scenario, a time interval of 1 minute starting at midnight will generate 1440 list entries.

6. As stated in Setup, if you specify a script in your data file that is not in your default scripts folder, you will be asked to locate it via a Choose File dialog. Since Script Timer processes each line in the data file independently, this will occur every time the script name appears in the data file. If you plan to schedule the use of a script with Script Timer several times in your data file, it is a good idea to move it into the default scripts folder that you specified when you first launched the program.

7. Since the log file grows as the program is used, it could eventually become quite large. You should remove unwanted entries from the log file on a regular basis to avoid this situation. Registered users will receive an AppleScript to schedule with Script Timer to do this automatically. You can also do this manually with a text editor. Note that in OS 9.2.1, the SimpleText text editor cannot open files that exceed 32 K in size, so you will not be able to open the log file with it if you let the file become too large.

8.Care must be taken when Script Timer has been designated as a Login Item in OS X or a Startup Item in OS 9.2.1. If an error condition is detected that requires user action to resolve, the program and possibly the rest of the start up sequence will not proceed. To be safe always start it at least once manually if you have changed the data file or modified its contents while the program is not running, or else remain by your computer during start up.

9. In OS X there appear to be certain times when the creator/file type codes of a plain text file are changed to ttxt/TEXT, the signature of the Classic application SimpleText. For example, at least in OS X 10.0.x, this has been known occur should the Macintosh "Classic" environment rebuild the desktop. (If this happens in OS X 10.0.x you will know because the files' icons will change to the black bordered SimpleText document icon. Unfortunately, in OS 10.1, the icons will not change. Files of type TEXT are assigned to TextEdit in this version of the operating system.) This reassignment will cause problems when you want to make changes to the data and log files, which are TextEdit documents. Double clicking on the files will cause the Classic environment to start up, then SimpleText. If you drag the files onto the TextEdit icon, they will open but if you try to make any changes TextEdit will force you to save them in Rich Text Format instead of the plain text format that Script Timer understands. You will not be able to save them again as plain text files without changing their names. To overcome this problem, drag and drop the data and log file icons onto the AppleScript droplet "Type Fixer" included with Script Timer. It will restore the original state of the file information.

10. In OS X If you wish to change the default application that opens the data or log files, select the file in a Finder window, choose "Show Info" from the File menu, select "Application" from the popup menu, and navigate to your desired alternate text editor.

11. If you use this version of Script Timer with Mac OS 9.2.1, there are several things to note:

2.9 Sample Scripts

See the accompanying folder "Scripts to Schedule" for some examples of useful AppleScript scripts to get you started using Script Timer. You may also wish to place your own scripts in this folder and use it as your default scripts folder.

Registered users of Script Timer will receive an AppleScript for scheduling Internet FTP file downloads using the popular Internet engine Interarchy. This is particularly handy for scheduling downloads of software updates and other larger files while you are away from your computer. They will also get an AppleScript called Truncate Timer Log to schedule with Script Timer to automatically trim the size of the log file.

2.10 If You Have Problems

If you have a problem with Script Timer that you cannot resolve on your own, or by viewing the Script Timer FAQ, please contact us with the following information:

This will assist us in diagnosing and resolving your problem as quickly as possible.

3. How to Register

3.1 Submitting Your Registration and Registration Fee

Apps & More Software Design uses the Kagi shareware registration system. You can register your copy of Script Timer on line using a major credit card, or you can print out and mail a registration form to Kagi along with cash (not recommended!), check, or money order. You register on line from a secure web site, or if you wish to register using cash, check, or money order you can use the web site to print out a paper copy of the registration form to be mailed in to Kagi.

As an alternative, you can use the Register application that came bundled with Script Timer to generate a registration form that you can email or send by traditional mail to Kagi.

NOTE: Register is a classic application. Unfortunately the currently available version does not function correctly in the Classic environment of OS X. Therefore, to use Register, you must boot directly into OS 9. For this reason its use is not recommended in OS X unless you are having difficulty with the Kagi web site.

It is very important to provide either an e-mail address or a postal address so that Kagi can send you your registration code. This code will make your copy of the program permanent. (See Section 3.2.) If you do not have an email address you should consider selecting the Postal Receipt .

The registration fees for Script Timer are given in Section 1.3. Script Timer 1.2 is a free upgrade for registered users of a previous version of the program. If you are upgrading, your personal registration code for the previous version will still be valid and can be used to fully enable the new version. If you have lost your registration code, please contact Apps & More to have it sent to you.

Registering Online (credit card) Preferred Method

1) Point your web browser at <http://order.kagi.com/?95N>
2) Choose the program you wish to register, quantity, and license type. Add comments if you wish.
3) Click Continue. You will move to a secure web page.
4) Fill out all of the information, including your email address and your credit card information.
5) Click on Purchase.

Registering By Snail Mail (cash, check, money order)

1) Point your web browser at <http://order.kagi.com/?95N>
2) Choose the program you wish to register, quantity, and license type. Add comments if you wish.
3) Click Continue. You will move to a secure web page.
4) Fill out all of the information, including your email address and street address.
5) Choose the Check/Money Order or Cash option at the bottom of the page.
5) Click on Purchase.
6) Print out the registration form presented on the next web page. Then bundle up the registration form and your cash, check, or money order and mail it to the postal address on the page. Please be sure to include the line:

PMB #392-95N

as shown in the address.

Registering By Email using Register (credit card)

1) Restart your computer in OS 9.
2) Run the Register application.
3) Fill out all of the information, including your email address, the program you wish to register, and your credit card information.
4) Save the information to a text document, then copy and paste it into the body of an email message. Send the email to: shareware@kagi.com

Registering by Conventional Mail using Register (cash, check, or money order)

1) Restart your computer in OS 9.
2) Run the Register application.
3) Fill out all of the information, including your postal address and the program you wish to register.
4) Print out the registration form.
5) Bundle up the registration form and your cash, check, or money order and mail it to the address below:

Kagi
1442-A Walnut Street
PMB #392-95N
Berkeley, California 94709-1405
USA

 

3.2 Making Your Copy of Script Timer Permanent

Once Kagi has received and processed your registration, you will be sent your individual registration code. You will use this code to convert your trial copy of Script Timer into a permanent version. If you register on line, you should receive the code immediately; if you order by email, you should be get the code via a return email a short time later. If you register by conventional mail, please allow a reasonable time to receive your code by return mail, then contact us if you think there is a problem.

If the reply from Kagi does not contain a message from Apps &More Software Design, Inc. including your 8-digit registration code, please contact us immediately.

When you have your registration code, simply drag and drop a valid data file onto the Script Timer icon as described above in Section 2.3. The Registrar plug-in, which should be in the same folder as Script Timer, will load and the registration dialog will appear. Fill in your registration code and click on the Validate button. The Registrar will check that you have entered the correct code, and if so, the program will proceed using the data file you have just dropped on its icon. If the registration code is invalid, an error message dialog will appear, giving you the opportunity to try again to enter the correct code or to quit the program.

Once the program is successfully registered, you will not see the registration dialog again.

 

4. Fine Print

Distribution - You may distribute this program electronically in any way you wish as long as you don't charge for it. You are encouraged to pass along the original distribution package to friends and colleagues.

Disclaimer - Apps & More Software Design, Inc. hereby disclaims all warranties relating to this software, whether express or implied, including without limitation any implied warranties of merchantability or fitness for a particular purpose. Apps & More Software Design, Inc. will not be liable for any special, incidental, consequential, indirect or similar damages due to loss of data or any other reason, even if Apps & More Software Design, Inc. or an agent of theirs has been advised of the possibility of such damages. In no event shall Apps & More Software Design, Inc. be liable for any damages, regardless of the form of the claim. The person using the software bears all risk as to the quality and performance of the software.

 

Appendix A: Error Messages

This appendix contains a list of error messages generated by Script Timer for anticipated problems. If you receive an error message from the program that is not listed here, please contact Apps & More Software Design to report the error message and error number.

Error Conditions at Program Launch or Data File Change

Error conditions detected at program launch or data file change appear in dialog boxes and suspend execution of the program until the user responds. (These errors are also written to the log file so that you will have a record to examine later.) The most likely causes of an error at this time are a problem with the data file or a missing script. The usual user action is to quit Script Timer, correct the problem in the data file, and relaunch.

 

Error opening file: Script Timer log.txt
some error message
Number error number
Script Timer will be terminated.

An unexpected error occurred when the program attempted to open the log file. This error will not occur if the log file is already open in another application - in that case a new log file may be created with a '#' inserted in the name before the ".txt" extension.

  

The Registrar plug-in must be present to register your copy of the program.

You will see this message if Script Timer cannot locate the Registrar plug-in that comes with Script Timer, and when it asks you to do so, you choose 'Cancel' in the Choose File dialog. The plug-in must be present on your system in order to complete the registration process. By default, it resides in the same folder as Script Timer. If you cannot locate the Registrar plug-in, please contact Apps & More Software Design. (You will still be able to use the program in its unregistered state.)

 

Sorry, that is not a valid registration code.
the code you have entered

Script Timer has failed to recognize the code you have typed in as valid for your copy of the program. Examine the code, find the error if any, correct it and try again. If you believe your entry to be correct (i.e. exactly matching the code sent to you by Kagi), please contact Apps & More Software Design. If you click on the Later button, Script Timer will proceed, but your trial period will still be in effect. (Note that even after the trial period has expired, you can still register.)

 

Script Timer 1.2 error number -32767: Incorrect line in data file:
problem line from data file
Must be of form "script name<tab>frequency<tab>time[<tab>wait]"
Please correct the error and restart.

Every nonblank line in the data file that does not start with an exclamation mark (!) must be in the form indicated. There can be three or four fields only, separated by tabs (indicated above by <tab>). Note that the script name may contain spaces, and that the space between the time and the 'AM' or 'PM' indication is optional. The wait time is optional, as indicated by the square brackets. If not specified, it defaults to 60 seconds. (Note: non zero wait times are only meaningful in OS X.) If the data line looks correct, but you still get this error, check that you have not inadvertently substituted spaces for tabs, or that you have not included extra tabs between the data fields or at the end or beginning of the line. Recall that the square brackets are NOT part of the wait time field and should not be included on the data line.

 

Script Timer 1.2 error number -32766: Incorrect specified run frequency: "frequency".
Specified run frequency must be "once", "daily", "weekdays", or the name of a day of the week.
Please correct the error and restart.

The program will accept only the indicated words (without quotes) as specified run frequencies. The days of the week are known to the program as Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, and Saturday.

 

Script Timer 1.2 error number -32764: The data file "filename" contains no active entries. Lines starting with "!" are ignored.
Please correct the error and restart.

The current data file is not empty, but all lines in it start with an exclamation mark ("!") or are blank. Such lines are ignored when Script Timer makes up the master script list, so no scripts can be executed. This is the initial state of the sample data file included with the program.

 

Script Timer 1.2 error number -32763: "script name" was not located.
Please correct the error and restart.

When Script Timer cannot locate the script "script name" in the data file, it presents the user with a Choose File Dialog, giving the user an chance to indicate where the script resides on the system. This message is caused by choosing "Cancel" in the dialog, which terminates the program. Note that "script name" could also refer to an application or file you want to launch/open asynchronously.

 

Script Timer 1.2 error number -32762: Unknown error checking run frequency of script list entry.
Please correct the error and restart.

This message should never come up. If you see it, please send a report to Apps & More Software Design outlining the circumstances under which the error was generated along with a copy of the text in your data file.

 

Script Timer 1.2 error number -32761: Time interval must be positive.
Please correct the error and restart.

Interval run frequencies always start with a number which indicates the number of minutes, hours, days, or weeks . This number must be greater than zero.

 

Script Timer 1.2 error number -32760: Incorrect time interval unit "time unit"
Please correct the error and restart.

The time unit for an interval run frequency must be one of minutes, hours, days, or weeks, or the singular forms of these.

 

Script Timer 1.2 error number -32759: Incorrect run frequency: "day n"
Illegal day of of month.
Please correct the error and restart.

The day of the month, n, must be a non zero integer whose absolute value must be less than or equal to the number of days in the current month.

 

Script Timer 1.2 error number -32758: Incorrect run frequency: "day xxxx"
Day of month must be a number.
Please correct the error and restart.

The form of the monthly frequency interval is "day n", where n is an integer.

 

Script Timer 1.2 error number -32757: Incorrect run frequency: "xxxx day name"
Unrecognized ordinal.
Please correct the error and restart.

When specifying a specific day of the month as a frequency in terms of which weekday it is, the only ordinals allowed are first, second, third, fourth, and last.

 

Script Timer 1.2 error number -32756: Incorrect run frequency: "ordinal xxxx"
Unknown weekday name.
Please correct the error and restart.

When specifying a specific weekday of the month as a frequency, the name of the day was not recognized by the program. Check your spelling carefully. The recognized spellings are given here.

 

Script Timer 1.2 error number -32755: Missing right parenthesis in <script name(parameter list>
Please correct the error and restart.

The argument list following the name of a parameterized script must be enclosed in parentheses. The right parenthesis is missing at the end of the list.

 

Script Timer 1.2 error number -32744: No scripts folder chosen.
Please correct the error and restart.

When you first run Script Timer, the program will ask you to specify a default folder to hold the scripts you want to schedule. You will see this error message if you choose "Cancel" in the Choose File dialog. Without a scripts folder specified, the program cannot run.

 

Script Timer 1.2 error number -32743: No data file specified.
Please correct the error and restart.

The data file should be in the same folder as it was when Script Timer was last launched. If it is not found there, the program will display a Choose File dialog and ask you to locate it on your system. You will see this error message if you choose "Cancel" in the Choose File dialog. Without a data file, the program cannot run.

 

Script Timer 1.2 error number -32742: The trial period for this copy of the program has expired. To reactivate it, please register.
See Section 3 of the User's Manual for how to register.

The 30 day trial period for your copy of Script Timer has ended, and it will no longer function. You can reactivate it by obtaining your registration code as discussed in Section 3 of this manual, and then carry out the registration procedure.

 

Script Timer 1.2 error number -32741: Wait time must be a nonnegative number.

The wait time (the time in seconds that you want Script Timer to wait for a particular script to complete) must be zero or a positive number. Even though a wait time other than zero has no meaning in OS 9.2.1, you will still get an error if you enter a negative number in this field.

 

Script Timer 1.2 error number -30720: Invalid date and time xxxx
Please correct the error and restart.

Script Timer does not recognize the character string xxxx as a valid date and time. The time string in the data file must contain only numbers, which may be separated by colons (:) to indicate hours, minutes (optional), and seconds (optional), and the 'AM' or 'PM' designation. A 12-hour or a 24-hour clock may be used. Minutes and seconds, if present, must be in the range 0 to 59. If no error is apparent, make sure that there is no trailing space in the time data field.

 

Error attempting to execute <name> Number -108 Out of Memory.

This error may occur in OS 9.2.1. If you see this message, you must increase the memory allocation for Script Timer from the Finder. To do this, click on the Script Timer icon to select it, then choose Get Info from the File menu or type command-I. Then choose Memory from the popup menu in the Get Info window. Type in a larger value for the Preferred Size at the bottom of the window and close the window.

 

Script Timer 1.2 error number -43: The data file "file name" is empty.
Please correct the error and restart.

The data file was located, but it does not contain any data, even comments.

 

Error Conditions and Other Messages After Program Launch

Once Script Timer has read the data in the data file, determined that it has the correct form, and used it to create its master script list, the program is assumed to be running unattended. Therefore, it endeavors to handle all error conditions on its own, and to carry on running. All error and other messages are recorded in the log file, starting with a time stamp so that you can see later what happened and when it happened. Note that error messages for errors occurring in synchronous scripts that cause the script to terminate will also be recorded in the log file.

The general form of a messages is:

Time stamp: message

where message is one of the following:

Script Timer 1.2 restarted.

This message is recorded in the log file when the program is restarted by any means.

 

New script list with n items created using data file "data file name "

This message appears in the log file whenever a new master script list has been created. It will occur when Script Timer detects that the current data file has been modified or replaced.

 

Using existing script list from data file "data file name "

This message appears in the log file whenever Script Timer is restarted and the current data file has not been changed since it was last started.

 

New run list with n items created.

Whenever you start Script Timer, and every day at midnight, the program prepares a run list for the new day from the master script list kept by the program. This message confirms that a new run list has been created, and how many items are on it for the rest of that day. Run items with start times earlier in the day than the time of creation of the new run list will be excluded from the list, except for one time runs, which will be rescheduled for the next day at the designated time. Runs scheduled for exactly midnight (12:00 AM) will be included in the previous day's run list.

 

Script Timer 1.2 terminated.

The message indicates that Script Timer has been sent a "quit" message either by you quitting the program, or by the operating system (for example, on system shutdown or log out).

 

This copy of Script Timer 1.2 will expire in less than n hours. To assure continued use, please register.

You will begin to see this message in the log file approximately 4 days (96 hours) before the expiry of your trial period. The message also appears on the screen, and you are given the opportunity to immediately register the program.

 

Starting <script name(parameter list)>. (Run Number: run count)

This message indicates that the named script is about to be started by Script Timer using the indicated parameters, if any. (See Appendix B.) The run count is the cumulative number of scheduled script launches that the program has made since you first ran it.

 

<script name> completed. (Run Number: run count)

This message indicates that the named script has run to completion. The run count is the cumulative number of scheduled script launches that the program has made since you first ran it.

 

Warning! Execution time of < script name> exceeds wait time seconds. Script will be allowed to finish. (Run Number: run count )

The named script has not completed within the designated wait time. (If you do not specify a wait time in the data file, wait time is set to 60 by default.) This message is for information purposes only. As indicated, your script will be allowed to continue running. Script Timer will also resume, no longer waiting for your script to complete, and the eventual termination of the script will NOT be noted in the log file. Note that you should not see this message if running OS 9.2.1 where wait times other than zero are ignored.

 

Error attempting to execute <script name> Number error number:
Error message

The named script has generated the error indicated while attempting to execute, and has not handled that error on its own. The script will have terminated at the point of the error.

 

Appendix B: Sample Parameterized Script

There are times when a parameterized script is convenient - for example if you want to display various messages to yourself at different times of the day using the supplied "Reminder" script. As such scripts are less common than non parameterized scripts, they are discussed here.

AppleScript allows you to pass parameters to a script. The script must have a run handler, and the parameters are contained within curly braces as a comma separated list at the end of the first line of the run handler. If you include a comma separated list of values (an argument list) for these parameters between parentheses at the end of the script name in your data file, Script Timer will substitute them one for one for the parameters in the curly braces. Note that a value must be included for every parameter, and that Script Timer will interpret each argument as a character string. Your script may need to explicitly convert the character string into a different variable type. (This is not necessary for numbers, AppleScript does the conversion implicitly.) If your argument is a character string, you do not need to enclose it in quotation marks. If you do, those marks will become part of the argument. Also note that your argument character strings may contain a right parenthesis character - Script Timer will recognize that it does not terminate the argument list.

A parameterized script has the general form shown below. (There is no restriction on the number of parameters.) Note that you can only compile, not run, a parameterized script in the AppleScript Script Editor. If you try to run it, you will get an error, because the Run button in the Script Editor does not send any parameter values.

on run {parameter 1, parameter 2, parameter 3}
-- AppleScript statements using the parameters go here
end run

Assuming you have entered this script into the Script Editor and saved it as a compiled script named "MyScript", here are two sample data file lines showing you how to use it:

MyScript(value 1, value 2, value 3)

Monday

8:30

MyScript(value 4, value 5, value 6)

daily

3:55 PM

If placed in your data file, these lines will cause MyScript to be run every Monday morning at 8:30 AM with the values value 1, value 2, and value 3 substituted in the script for the parameters parameter 1, parameter 2, and parameter 3, and every day at 3:55 PM with a different set of values value 4, value 5, and value 6 being used in place of the three parameters. See the 'Scripts to Schedule' folder for an actual example of a parameterized script, the Reminder script.

 

Appendix C: References

The following references are recommended for Apple Script:

1. Apple Computer's AppleScript home page:

http://www.apple.com/applescript

2: AppleScript Language Guide:

http://developer.apple.com/techpubs/macosx/Carbon/interapplicationcomm/AppleScript/applescript.html

3. Danny Goodman's AppleScript Handbook 2nd Edition, Random House,1994, ISBN 0-679-75806-2

This is still an excellent resource, even though it is out of print and hard to come by.

4. AppleScript in a Nutshell by Bruce W. Perry, O'Reilly, 2001, ISBN 1-56592-841-5

The most up to date book, concise and accurate.

 

Appendix D: Downgrading AppleScript in OS 9.2.2

In addition to Script Timer not working in OS 9.2.2, many scripters have reported problems with scripts that previously ran fine before they installed OS 9.2.2. The problems appear to be related to the implementation of AppleScript 1.7 in OS 9.2.2, since that version works fine in OS X 10.1. Fortunately, AppleScript version 1.6 will work fine in OS 9.2.2. Here is what you need to do to replace AppleScript 1.7 in OS 9.2.2 with version 1.6:

1. Obtain a copy of AppleScript 1.6.smi from the Apple Computer web site.
2. Remove 'Standard Additions' from the Scripting Additions folder in your System Folder.
3. Remove 'AppleScript' from the Extensions folder in your System Folder.
4. Restart your computer.
5. Double click on the self mounting image file obtained in Step 1. This puts a disk image called 'AppleScript Install' on your desktop.
6. Double click on the disk image, then double click on the Installer program.
7. Make sure you have selected your boot disk for installation, then click on Install.
8. Reboot. You will now have AppleScript 1.6 installed. (Note: You will still have Script Editor 1.7 installed, but this appears to work fine with AppleScript 1.6.)

ö¡¸§õœ¸Ïúfl˝ST_manual.html001cesnsionlder08TEXTBlWdˇˇˇˇ@µÿä≈Ù‚ġˇˇ,ġˇˇ4È¿ˇˇˇÄˇˇflġˇ#ġˇߡˇ´Internet Config rDamagedAlert rMiscStrings Chaˇˇ