Just curious
Just curious
- Subject: Just curious
- From: "Wallace, William" <email@hidden>
- Date: Wed, 20 Nov 2002 10:10:08 -0600
For some reason my original post didn't make it into the list (my second one
did, but it referred to stuff in the first post, so it didn't make much
sense). Here are both posts combined into one:
For the following, please bear in mind that I'm still in the poking around
and exploring stage of learning AppleScript. I'm just a little mystified by
some quirky behavior that I stumbled upon.
If I enter this into a Script Editor window and run it:
display dialog "Pointless!" giving up after 3
quit
I get an error saying "couldn't run script because a script is running". I
assume that this means that the quit command was directed to Script Editor
which couldn't fulfill the request because it was busy running the script
which sent the command. If I save the above script as an application it
behaves how I would expect (it displays the dialog and then quits).
If I save this as an application:
display dialog "Pointless!" giving up after 3
tell application "quitter" to quit
It works just fine, but if I run it from the Script Editor window, the
dialog appears and then goes away after three seconds but the script doesn't
quit and the application menu blinks an alert. Script Editor becomes
unresponsive and I have to command-tab or click on the desktop to switch to
another app. Then I find (not altogether surprisingly) that the "tell"
statement has launched the compiled application "quitter" and then another
"Pointless!" dialog box is displayed. However, I noticed that the dialog box
either didn't show up until I switched to the "quitter" application or the
countdown to giving up didn't begin until I switched to the "quitter"
application. Once "quitter" becomes the active app, it behaves as expected.
However, when I subsequently switch back to Script Editor, the original
script appears to still be running (spinning beachball). Why? And why
wouldn't the launched script application just do its thing quietly in the
background?
If I save this as an application:
display dialog "Pointless!" giving up after 3
ignoring application responses
tell application "quitter"
display dialog "Pointless!" giving up after 3
quit
end tell
end ignoring
I get an error instead of the second dialog. It says '"Pointless!" doesn't
understand the display dialog message.' If, however, I run the above from
Script Editor, there is no error. The second dialog never pops up, but there
is no error. I used MacArmyKnife's process manager window to verify that
'quitter' does in fact launch and quit. I just never see the dialog box. If
I remove the "ignoring" wrapper, it behaves fine if run as an application,
but not from Script Editor.
hmmm.
-whw
PS - I'm on OS 9.2.2 with AS 1.8.3
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.