A Yummy (_Not_) Bug: Gremlin is Rewriting my GUI-Scripting
A Yummy (_Not_) Bug: Gremlin is Rewriting my GUI-Scripting
- Subject: A Yummy (_Not_) Bug: Gremlin is Rewriting my GUI-Scripting
- From: Jonathan Levi MD <email@hidden>
- Date: Sun, 28 Aug 2005 12:23:12 -0400
Hi all,
Recently, a script of mine failed repeatedly when
run from the Script Menu. I discovered that
tell-blocks to System Events had been silently
rewritten, e.g.,
from the original
tell application "System Events"
repeat until ((exists process "MPW Shell") and ¬
(frontmost of process "MPW Shell" is true))
end repeat
delay 1
tell process "MPW Shell"
keystroke "a" using command down
keystroke "v" using command down
keystroke "s" using command down
keystroke "w" using command down
keystroke "q" using command down
end tell --process mpw
activate
repeat
if not (exists process "MPW Shell") then
tell application "Finder" to open editMBFile
tell application "MPW Shell" to launch
exit repeat
end if
end repeat
end tell
to
tell application "Script Editor"
repeat until ((exists «class prcs» "MPW Shell") and ¬
(frontmost of «class prcs» "MPW Shell" is true))
end repeat
delay 1
tell «class prcs» "MPW Shell"
«event prcskprs» "a" given «class faal»:command down
«event prcskprs» "v" given «class faal»:command down
«event prcskprs» "s" given «class faal»:command down
«event prcskprs» "w" given «class faal»:command down
«event prcskprs» "q" given «class faal»:command down
end tell --process mpw
activate
repeat
if not (exists «class prcs» "MPW Shell") then
tell application "Finder" to open editMBFile
tell application "MPW Shell" to launch
exit repeat
end if
end repeat
end tell
Similar changes occur (including substitution of
Script Editor for System Events) in two other
places whenever I have System Events issue tells
to process MPW Shell or process Eudora.
Submitting this as a bug will be somewhat problematical:
- The script is long and pulls in several other scripts and files,
hence it would have to be boiled down to something minimal that
still reproduces the problem;
- I'm still running Panther; and
- Perhaps this bug is already known, particularly to people on
this list. For example: someone recently pointed out that there
may be problems when one is working with Classic applications;
someone else mentioned the Launch Services cache (I trashed
/Library/Caches/com.apple.LaunchServices.6B.csstore, and still
got the error.)
Correcting the unwanted rewrite is fairly simple,
if tedious: I replace 'tell application "Script
Editor"' by 'tell application "System Events"' in
all cases and recompile; the raw codes then clear
up spontaneously. I believe I've managed to avoid
the problem altogether by not running the script
from Script Menu while the Script Editor is also
running.
Any suggestions? TIA,
Jonathan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden