• 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
Re: Simplest script fails
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simplest script fails


  • Subject: Re: Simplest script fails
  • From: Chris Page <email@hidden>
  • Date: Wed, 9 Jul 2003 09:37:19 -0700

On Wednesday, Jul 9, 2003, at 08:39 US/Pacific, Thomas England wrote:

I have a simple script to quit one program...
What puzzles me is that sometimes it works, sometimes it doesn't. When it fails I get a dialog box saying "Connection is invalid"...

tell application "Digest Viewer" to quit

When you tell an app to Quit, it usually quits without sending back a reply to the event. Normally, AppleScript waits for a reply to every event. If the application it's waiting on goes away without replying, AppleScript returns an error about the connection being lost. What's surprising is that this doesn't produce an error every time.

In any case, the solution is to tell AppleScript to not expect a reply:

ignoring application responses
tell application "Digest Viewer" to quit
end

--
Chris Page - Software Wrangler - Palm, Inc.

That's "Chris" with a silent *and* invisible "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: Simplest script fails
      • From: Emmanuel <email@hidden>
References: 
 >Simplest script fails (From: Thomas England <email@hidden>)

  • Prev by Date: Simplest script fails
  • Next by Date: Re: iChat Auto Responder Load Test
  • Previous by thread: Simplest script fails
  • Next by thread: Re: Simplest script fails
  • Index(es):
    • Date
    • Thread