spurious timeout on nth Apple event on Snow Leopard
spurious timeout on nth Apple event on Snow Leopard
- Subject: spurious timeout on nth Apple event on Snow Leopard
- From: Matt Neuburg <email@hidden>
- Date: Tue, 06 Oct 2009 17:00:45 -0700
- Thread-topic: spurious timeout on nth Apple event on Snow Leopard
In connection with the bug reported by Hagimeno and others, I have sent to
Chris Nebel the following script, which all are welcome to try on their Snow
Leopard machines:
set i to 0
try
tell application "Finder"
repeat -- forever
with timeout of 5 seconds
set i to i + 1
count Finder windows
if i > 70000 then
display dialog "You passed the barrier!"
return
end if
end timeout
end repeat
end tell
on error errMsg number errNum
display dialog i
error errMsg number errNum
end try
On my Snow Leopard machine, we *never* reach 70000. The script always
encounters a timeout at about the 65000th Apple event. (I do not know
whether it is a coincidence that this is approximately 2^16.) Users are
welcome to try for themselves, tweak the script, etc. There is nothing
sacred about its form (in fact, it isn't even a very well written script,
it's just a silly way of sending and counting a whole lot of Apple events).
The timeout is spurious, as the Finder is not busy. The problem, indeed, has
nothing to do with the Finder, as I can just as well target iTunes or
something else. In fact, it has nothing to do with AppleScript, since I can
reproduce it using rb-appscript or raw Apple events. There seems, rather, to
be something wrong with the underlying Apple event transport mechanism,
where the nth Apple event just craps out. The next Apple event then works
just fine, and so on until we reach the next nth event.
If the problem is connected with the maximum value of n being about 2^16, I
would suspect that some underlying mechanism is counting Apple events and
overflowing when the 2^16th event is encountered. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden