Occasionally I will have the problem where the System Events process constantly uses 65-100% of my CPU cycles, effectively crippling my machine. I traced the problem to having folder actions enabled, and then to a specific script. Because I use folder actions on mounted shares, I use a script to first mount all the network drives I use, and then delete all my folder actions and re-associate them with the correct folders. I have 4 actions that I use. 3 are on network folders and one on my local machine. I traced the problem by adding only 1 action at a time, and it turns out it is actually the action on a local folder that is the problem. The script monitors my HD:private:var:tmp:folders.501:TemporaryItems folder for temporary Quark files, and tells Quark to set the bounds to fit my screen layout. The script is below. Does anyone know why it would suddenly be chewing through my CPU like this? I should note that for about 90% of the time I’ve had this action installed, it has worked flawlessly without effecting CPU usage. Occasionally it would start using all my CPU, at which point I would delete the com.apple.SystemEvents.plist and com.apple.FolderActions.plist files, which would return my CPU to proper levels. Except this last time, deleting plist files doesn’t make a difference. As soon as the action is added again, CPU jumps back up.
on adding folder items to this_folder after receiving added_items
repeat with i in added_items
tell application "Finder" to if (name of i) contains ".qxp" then
tell application "QuarkXPress"
set bounds of every document to {22, 32, 916, 1180}
set view scale of every document to fit page in window
end tell
end if
end repeat
end adding folder items to
Model: PM G5
Browser: Firefox 3.6.16
Operating System: Mac OS X (10.4)