Idle Cuases Beachball in 10.4

Hey All,

I have a script attached to File Owner’s idle. The script is set to trigger every 5 minutes. Works fine in 10.5/10.6, but in 10.4, the program beachballs for the first 15 seconds. It operates fine after that, but I’d like to know why it’s beachballing, if anybody has any idea.

Here’s the script:

--[SCRIPT autosave4iWork.app]
(*
Original autosave4iWork script by Yvan KOENIG.
http://idisk.me.com/koenigyvan-Public?view=web
*)

property minutesBetweenSaves : 5
(* enregistrera toutes les 10 minutes *)

--=====
on idle theObject
	my auto4PKN("Pages")
	my auto4PKN("Keynote")
	my auto4PKN("Numbers")
	return minutesBetweenSaves * minutes
end idle

--=====

on auto4PKN(theApp)
	local titres, aDoc
	tell application "System Events" to set titres to title of processes
	if theApp is in titres then
		tell application theApp
			repeat with aDoc in every document
				if modified of aDoc then save aDoc
			end repeat
		end tell -- theApp
	end if
end auto4PKN

--=====
--[SCRIPT]

Thanks,
-Rob

Fixed. The problem was that “title” was used, which works with 10.5/10.6, but not in 10.4. Would return “missing value” for every process. Changed title to name, and all’s well.

tell application "System Events" to set titres to title of processes