Idle handler not working in 10.4 (Tiger)

Numerous Macs of different vintages are part of an art project.

I’ve written an applescript the uses an idle handler to make iTunes play if it is paused.

on idle
tell application “iTunes”
if player state is paused then play
end tell
end idle

The script is saved as an application that stays open.

It seems to be working on many of the machines running 10.5 and higher, but it’s not working on the Tiger machines.

The tell step works fine, but I need to have the script check periodically to see if iTunes is playing and start it if it is paused.

Any advice on what I am missing?

Thanks!
Larry

I’m answering my own post because the script started working on at least one of the Tiger machines.
So, for now, the problem has disappeared…

:slight_smile:

Hi.

An idle handler should explicitly return an integer telling the system how many seconds to wait before calling it again. Otherwise the result of the last action performed is used. If I remember rightly, the default in the event of zero, a non-number, or a non-existent result is 30 seconds.

on idle
	tell application "iTunes"
		if player state is paused then play
	end tell
	
	return 60 -- or however many seconds you need.
end idle