NOTE: This page describes Revision 7.1 of Track Timer.
Inputting Data From a File
Track Timer provides an interface between the media playing capabilities of iTunes and the scheduling capabilities of Script Timer. It is designed to be scheduled by Script Timer, allowing you to:
• schedule and control the playing of any iTunes play list of music, streaming audio, or both,
• play any number of tracks in any order from any play list, including random order,
• schedule the playing of any number of play lists at any time of the day, week, month or year, on a recurring time interval, at system wake up, at log in, or at idle state change
• specify the sound volume for each playing,
• ramp the sound volume of a play list up or down (to wake or fall asleep to music), and
• cause another action to be scheduled for execution following the completion of your play list (or earlier if you wish) using Script Timer's dynamic scheduling feature.
Dynamic scheduling allows an AppleScript script such as Track Timer to specify "on the fly" a further action to schedule, and when to schedule it. It is particularly useful for streaming audio as it provides an easy way to terminate the stream when used to schedule the "stopiTunes" script that comes with Track Timer.
The screen shot below shows a Script Timer action panel, which you use to specify the scheduling details of an action you want to schedule. You tell Script Timer to schedule Track Timer, passing the name of the play list and the tracks you want played from the list in the Parameters field of the action panel. You can also use the Parameters field to specify one or more control parameters that allow you to adjust details such as the sound level.
In the example below, a single random track from the play list "Jazz Faves" will begin playing at three quarters volume at 6 P.M. every week day.
Figure 1: Setting Up a Track Timer Action in Script Timer
Here are a few more examples of parameter lists recognized by Track Timer, and their meanings:
Vintage Country - will play all of the play list "Vintage Country".
Avril, random, s=25 - will play a single random track from play list "Avril" at one quarter full volume.
Water Music, Overture - will play the track "Overture" from the play list "Water Music".
My List, s=50,1,4,6,2,3,9 - will play the indicated tracks from play list "My List" in that order at half full volume.
Boyz II Men, Mama, Girl in the Life Magazine - will play the tracks named "Mama" and "Girl in the Life Magazine" from the play list "Boyz II Men".
RadioStream1, a=stopiTunes, d=7200 - will play the audio stream "RadioStream1". After two hours (7200 seconds) the script "stopiTunes" will be executed.
Jazz, a=repeat, 1, r=3 - will play track 1, then play 3 randomly selected tracks from the play list "Jazz". This will repeat continuously.
The last two items show how Track Timer takes advantage of Script Timer's dynamic scheduling feature. The "a" parameter specifies a script or application to schedule, and the "d" parameter specifies the number of seconds after the start of the play list to run that item. If the "a" parameter is set to "repeat", Track Timer will be continuously rescheduled to start at the time the last track finishes playing. ("d" defaults to the duration of the track selection if not specified.)
Inputting Data From a File
Instead of using the limited real estate of the "Parameters" field in a Script Timer action panel to enter your play list, track data, and options, you can specify a plain text file from which to take this information. You specify the file using the "f" parameter and the POSIX-style (with slashes ("/")) path to the file. You can specify the file path in three ways:
- if the file is in a folder called Script Timer in your home Application Support folder, you only need the file name
Example: f=MyTracks.txt (file is at /Users/YourName/Library/Application Support/Script Timer/MyTracks.txt)
- you can specify the path to the file using the tilde (~) notation to represent your home folder
- you can specify the complete POSIX path to the file
The data in the file must be in the same form as if it were in the action panel "Parameters" field - that is, as a comma-separated list of items, with the play list name coming first, and no new line or return characters. You can save the file either as eight bit or sixteen bit (UTF-16) plain text.
Track Timer comes with five helper scripts, designed to help you achieve various effects. If you want to use any of these scripts, it is recommended (but not required) that you copy them to your Script Timer “Designated Items to Schedule” folder for convenience.
pause iTunes - if iTunes is currently playing, pause it
Use this script as a convenient way to pause the music you are listening to while you are away from your computer. Simply schedule it in Script Timer to run as a Triggered action at start of idle. When your computer becomes idle (or you make it idle by moving your mouse to a "hot corner" you have established in your Screen Saver preferences panel), your music will immediately stop.
play iTunes - if iTunes is currently paused, start it playing again from where it last played
This script is a complement to the 'pause iTunes' script. Schedule it to run as a Triggered action at end of idle. When you resume use of your computer, your music will also resume where you left off.
playpause iTunes - combines the above two scripts to toggle iTunes between play and pause
sound ramper - change the sound volume up or down while iTunes is playing
Use this script to change the sound volume of your iTunes playlist during play. It is designed to be used in conjunction with Track Timer and Script Timer's dynamic scheduling feature to allow you to gently wake up or go to sleep to music or an audio stream. For example:
MyPlayList, a=sound ramper(20,0), d=0
will start the play list "MyPlayList" in iTunes at the current sound volume level and decrease the volume evenly in 20 steps so that at the end of the play list it is at zero.
stop iTunes - stop the current track and reset the play marker to the front of the track
Use this script to completely stop iTunes play. It is intended to be used in conjunction with Track Timer and Script Timer's dynamic scheduling function to stop play at the time you want. Particularly handy if you want to automatically stop an Internet radio stream after a certain length of time.