Re: Finder's open event has properties? Cal?
Re: Finder's open event has properties? Cal?
- Subject: Re: Finder's open event has properties? Cal?
- From: email@hidden
- Date: Mon, 4 Dec 2000 17:42:41 -0500
On Mon, 04 Dec 2000 11:11:22 -0800, Paul Berkowitz <email@hidden>
suggested,
>
Actually, 'application file id "xxxx"' is a special construct: the object
>
isn't the standard Finder file object, although it is a subset of it. So
>
the "dummy-saver" coercion may be restricted to this use.
The construct 'application file id "xxxx" ' is a standard reference form,
specifying an object of the Finder by its ID. It returns a Finder 'file'
reference. ('file "SurfWriter" of folder "SurfOffice" of disk "Big Disk" ') The
ID reference form is pretty wide-open to the particular application to
interpret. If you read the section in Chapter 5 (Objects and References) of the
AppleScript Language Guide, you'll see it says,
Applications are not required to support ID properties. To find out
if or how an application uses ID properties, see the documentation
for the application.
Now it turns out that the Finder dictionary says you can get application files
of the Finder by their ID property, (which works as we see). It also says you
can get application files of a container by their ID, and that doesn't work.
Its not a coercion, is simply the standard Apple Event formUniqueID 'ID ' key.
Not as common as reference by name or by index, but still valid. The Finder has
to do the work of actually interpreting that reference form.
"Peter Fine" <email@hidden> was quoted by Paul to have said on 12/4/00 9:47
AM,
>
> Apparently, AppleScript knows to translate "open file
>
> id "foo" with properties {visible:false}" into "launch app "foo"" if the
>
> file is an app. Since your code compiles without complaint and performs its
>
> trick at runtime, the analogy to a coercion seems apt. Whether it falls
>
> within the strict definition of a coercion, however, I don't know. I thought
>
> that when you coerced something you were transforming one data type into
>
> another. That's not exactly what's happening here.
Again, look at the Finder's dictionary. The 'open' event includes a "with
properties record" argument. Its explicit.
But I tried 'open application file ID "R*ch" with properties { visible:false } '
and got an ordinary startup by BBEdit, while "launch app..." gives nothing.
They aren't the same. "open application... with properties" sends an "open"
event to the app, with a <<class prpt>> argument. That's going to invoke a
handler in the application, which will have to interpret the property list
provided and do the right thing.
Launch, on the other hand, causes the system to load the application program
into memory and start it running, but doesn't send it a "run" Apple Event. And
that's not the same thing as being background-only, or not visible, or hidden in
the Finder.
--
Scott Norton Phone: +1-703-299-1656
DTI Associates, Inc. Fax: +1-703-706-0476
2920 South Glebe Road Internet: email@hidden
Arlington, VA 22206-2768 or email@hidden