Re: Simplest script fails
Re: Simplest script fails
- Subject: Re: Simplest script fails
- From: Emmanuel <email@hidden>
- Date: Wed, 9 Jul 2003 20:11:36 +0200
At 9:37 AM -0700 09/07/03, Chris Page wrote:
>
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' suggestion will most probably work but if it does not then tell Finder to "update" the application's file between the quit and the activate.
Emmanuel
_______________________________________________
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.