repeat try with timeout of 3600 seconds tell application "iTunes" if player state = stopped then set status_string to "(stopped)" else set current_name to name of current track set current_album to album of current track set current_artist to artist of current track set current_duration to duration of current track set remaining to current_duration - player position set remaining_m to remaining div 60 set remaining_s to remaining mod 60 if remaining_s < 10 then set padding to "0" else set padding to "" end if -- Swiss quotes --set status_string to "Ç" & current_name & "È by Ç" & current_artist & "È from the album Ç" & current_album & "È, " & remaining_m & ":" & padding & remaining_s & " remaining" -- U.S. English quotes set status_string to "Ò" & current_name & "Ó by Ò" & current_artist & "Ó from the album Ò" & current_album & "Ó, " & remaining_m & ":" & padding & remaining_s & " remaining" end if -- do shell script will convert the data to UTF-8 do shell script "echo " & quoted form of status_string & " > /tmp/itunes-status.txt" end tell end timeout delay 10 on error errMsg number errNum say "error" --display dialog errMsg delay 60 end try end repeat