Re: Prevent asking to locate application
Re: Prevent asking to locate application
- Subject: Re: Prevent asking to locate application
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 28 Mar 2004 22:01:27 -0800
On 3/28/04 8:37 PM, "Walter Ian Kaye" <email@hidden> wrote:
>
At 08:03p -0800 03/28/2004, Paul Berkowitz didst inscribe upon an
>
electronic papyrus:
>
>
> Just do this, using the version you have open on your compuer when you
>
> compile the script, and assuming you really can use the same script for Word
>
> as you can for AppleWorks, i.e. that all you need is to activate it. This
>
> script should work whether or not the application is currently open or not.
>
> (Walter's version only brings a currently open app to the front, it won't
>
> open it.)
>
>
Right; cuz he only asked about activating. I didn't go further
>
without knowing more about his script.
'activate' is often (most often, in fact) used to open rather than just
bring to the front, although it can do either. It seemed better to provide
an answer to could do both.
>
>
> tell application "Finder"
>
> if appChoice is "Microsoft Word" then
>
> set appFile to (application file id "MSWD")
>
> else
>
> set appFile to (application file id "BOBO")
>
> end if
>
>
>
> open appFile
>
> end tell
>
>
>
> Another way to do the same thing (in X) is:
>
>
>
> tell application "System Events"
>
> if appChoice is "Microsoft Word" then
>
> set appFilePath to (application file id "MSWD" as Unicode text)
>
> else
>
> set appFilePath to (application file id "BOBO" as Unicode text))
>
> end if
>
> end tell
>
>
>
> tell application appFilePath to activate
>
>
Umm, 'application file id' only works in Finder, not System Events.
>
In 10.2.8, anyway.
Very true. It need to be the Finder. I was trying to be too clever.
--
Paul Berkowitz
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.