• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Basic AppleScript theory
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Basic AppleScript theory


  • Subject: Basic AppleScript theory
  • From: "Wallace, William" <email@hidden>
  • Date: Tue, 19 Nov 2002 11:55:33 -0600

As I'm sure you're all painfully aware, I'm an absolute beginner with AS
(any kind of programing/scripting for that matter), so please bear with me,
and I apologize if this is an annoyingly stupid question. I've just been
fiddling around in Script Editor (I'm still in the poking around and
exploring stage of AS self-tutoring) and I stumbled upon a behavior that I
found a little confusing. Perhaps someone could illuminate this for me.

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?

-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.

  • Follow-Ups:
    • Re: Basic AppleScript theory
      • From: bryan <email@hidden>
  • Prev by Date: iTunes list to Toast MP3 List
  • Next by Date: Re: Error trap if item cannot be made into an integer?
  • Previous by thread: Re: iTunes list to Toast MP3 List
  • Next by thread: Re: Basic AppleScript theory
  • Index(es):
    • Date
    • Thread