on getInfoStr() tell application "AOL Radio" try set trk to current track set str to "Artist: " & (artist of trk) set str to str & ", Track: " & (name of trk) set str to str & ", Album: " & (album of trk) return str end try end tell end getInfoStr on subString(x, y, theString) return (characters x thru y of theString) as string end subString on getTime() tell application "AOL Radio" set tme to totaltime set ptme to playingtime return (tme / 1000) - (ptme / 1000) + 5 end tell end getTime set done to false set theDate to current date set f to ((path to "docs" as text) & "AOLRadio_" & (time of theDate) & ".txt") set nref to open for access file f with write permission set eof nref to 0 on getDateInfo() set theDate to current date set str to " " set str to str & date string of theDate set str to str & " " & time string of theDate & " " return str end getDateInfo repeat until done with timeout of 12 seconds write getDateInfo() & getInfoStr() starting at (1 + (get eof file f)) to file f delay getTime() end timeout end repeat