Mac OS X applications

Mac OS X applications

You write your actions in applescript
try
tell application "iTunes"
try
set the current_track to get current track
on error
error "No current track."
end try
set the track_count to (the count of tracks of the current playlist) as string
next track
try
set this_track to get current track
on error
play current_track
set this_track to the current_track
play track 1 of current playlist
set this_track to get current track
end try
set the track_index to (the index of this_track) as string
set this_title to the name of this_track as string
return (track_index & "/" & track_count & " " & this_title)
end tell
on error error_message
return error_message
end try
That's how you tell iTunes to play the next track