Re: Quit application
Re: Quit application
- Subject: Re: Quit application
- From: "Marc K. Myers" <email@hidden>
- Date: Thu, 15 Nov 2001 20:32:20 -0500
- Organization: [very little]
>
Subject: Quit application
>
To: email@hidden
>
From: email@hidden
>
Date: Thu, 15 Nov 2001 23:05:27 +0100
>
>
I am new to applescript (but an old Frontier-user) and need som help.
>
>
Can anybody tell me what I am doing wrong.
>
>
I am putting an application name into a variable.
>
>
This works:
>
>
tell application "Finder"
>
quit "Simple text"
>
end tell
Actually, it doesn't. It quits the Finder. For reasons too obscure to
go into, any "quit" command inside a Finder "tell" block will quit the
Finder, even if you try to direct it at another application.
>
This does not work
>
>
set v_appl to "Simple text"
>
tell application "Finder"
>
quit v_appl
>
end tell
>
>
Can anybody tell me why and what I'm doing wrong.
The Finder doesn't quit applications. Applications quit themselves.
You can do what you want with either of these structures:
tell application "SimpleText" to quit
or
set x to "SimpleText"
tell application x to quit
Just be sure that the code is not inside a "tell" block directed to the Finder.
Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074
[11/15/01 8:30:01 PM]