Check to make sure iTunes is playing - AppleEvent timed out. (-1712)

Hi folks, I've got some music that I want playing on iTunes all the time on an older system, but it'll sometimes stop. I tried making a Applescript to check and play the music/playlist again if it stops, but I keep getting a timeout error.

This is the AppleScript:

repeat tell application "iTunes" if player state is paused then tell application "iTunes" to play end if delay 30 end tell end repeat

I get this error: AppleEvent timed out. iTunes got an error: AppleEvent timed out. (-1712)

I can't figure out why I'm getting a timeout error... anyone have any ideas?

Sorry for the formatting, I am used to real forums, not ones that format differently and don't respect the returns entered in the text box. Also, I can't seem to edit my initial post, and I can't seem to find an AppleScript-specific forum or post to it. The code:

repeat
tell application "iTunes" 
if player state is paused 
then 
tell application "iTunes" to play 
end if 
delay 30 
end tell
end repeat
Check to make sure iTunes is playing - AppleEvent timed out. (-1712)
 
 
Q