home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 78 / maccd 78.iso / macware / Script Timer 1.01 / Sample Scripts / About Sample Scripts next >
Encoding:
Text File  |  2001-01-12  |  4.6 KB  |  49 lines  |  [TEXT/ttxt]

  1. Sample Scripts
  2.  
  3. This "Sample Scripts" folder contains a few sample scripts that you might want to schedule with Script Timer. Because Script Timer takes care of all the scheduling for you, these scripts are very short and simple. The three example scripts show you how to use a standalone script, a script for utilizing the scriptable Finder, and a script for controlling a third party program.
  4.  
  5. The scripts presented in this folder are for purposes of illustration only. Although they should work as expected on most systems, they are not guaranteed to function correctly on your system.
  6.  
  7. Registered users will receive an additional sample script that uses the popular Internet engines Anarchie and Interarchy to download files from the Internet.
  8.  
  9. Reminder
  10.  
  11. This very simple script can be used to give yourself a reminder of things you need to do during the day.
  12.  
  13. Here are two sample lines for your data file showing you how to use Reminder:
  14.  
  15. Reminder(Time for lunch!)    daily    12:00 PM
  16. Reminder(Staff meeting in 5 minutes.)    Friday    2:55 PM
  17.  
  18. Note that the three items on these lines -  the script name and message, the frequency, and the starting time, are separated by tab characters, not spaces.
  19.  
  20. If placed in your data file, the first line will cause your computer to beep at you and display the message "Time for lunch!" every day at noon. The second line will display the message "Staff meeting in 5 minutes." every Friday afternoon at 5 minutes to 3. In either case, the dialog box containing the message will remain on your screen until you hit the Return key or click on the OK button. Registered users can include as many message entries like these as they like in their Script Timer data file.
  21.  
  22.  Feel free to customize the Reminder script. For example, you could have it speak your message instead of or as well as displaying a dialog box. (The correct verb is "speak" or "say" depending on your version of AppleScript.) You could also have your message disappear after a set time under later versions of AppleScript by adding the words "giving up after n" to the end of the display dialog statement, where n is some number of seconds. Consult the documentation in the AppleScriptâ„¢ folder in the Apple Extras folder on your system disk.
  23.  
  24. EmptyTrash
  25.  
  26. This script can be used to tell the Finder to empty the Trash for you.
  27.  
  28. The following line in your data file will empty the Trash every three hours starting at 9:00 AM each day.
  29.  
  30. EmptyTrash    3 hours    9:00
  31.  
  32. Again, note that the three items on this line -  the script name, the frequency, and the starting time, are separated by tab characters, not spaces.
  33.  
  34. The Finder for OS 7.5 or later is completely scriptable and as well is recordable. This allows many interesting possibilities. You can manually go through a procedure using the Finder with the AppleScript Script Editor set to Record to record the your actions. A script is literally written for you in the Script Editor as you perform your actions. You can then save this script for later execution on its own, or in conjunction with Script Timer.
  35.  
  36. CheckMail
  37.  
  38. If you use Eudora for your mail program, try this script to check your mail automatically. If you use a different program, check its documentation to see if it is scriptable, and if so what the appropriate script commands are for checking the mail.
  39.  
  40. Note that like many e-mail programs, you can tell Eudora to check the mail every so many minutes. However, you have no control over when this periodic checking starts, and you can't set an irregular schedule. Also, Eudora must be running for its scheduling feature to work, and after the first mail check, you will remain on line. With this script, you can set any schedule you want, and you don't have to keep Eudora running. If you were off line before the mail check, you will go off line after the check is done.
  41.  
  42. This line in your data file will cause Eudora to check your mail daily at 8:30 AM:
  43.  
  44. CheckMail    daily    8:30 AM
  45.  
  46. Again, the three items on this line -  the script name, the frequency, and the starting time, are separated by tab characters, not spaces.
  47.  
  48. Most popular applications are scriptable - that is, they can be controlled by OSA scripts using application specific (and other) script elements. Consult the documentation that came with your favorite applications to see if they are scriptable. It may also help to open the application's scripting dictionary in the Script Editor application that comes with every Macintosh to see what commands are supported. Note that an application may be scriptable, but not recordable. If the application's documentation does not say whether or not it is recordable, you can easily test it out by trying to record some actions as discussed above.
  49.