[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] MacPerl + AppleEvents



At 11:46 +0100 9/3/98, Alan Fry wrote:
>Usually this is fairly clear. If the 'aete' is to hand in the readable form
>from David Schooley's 'aete.convert.pl', it can be seen immediately whether
>or not an 'object' is involved, and if so, what sort of object it is. For
>instance these (abbreviated) extracts from the Finder's 'aete' are quite
>explicit:
>
>...
>
>@EVENT  'FNDR', 'sope', "Open folders, files, etc. from a given folder",
>@DIRECT 'alis', "Alias for folder containing the items"

Finder is a particularly annoying beast.  The event above is the "old"
Finder open, where you told Finder

Open these things.  They are in this folder.  And here are complete aliases
for each item (which parameter isn't mentioned above...it's a list of
aliases).

Until MacOS 8, the actual "scriptable Finder" AETE was contained in an
Extension, and looking at the 'aete' resource in the Finder itself wouldn't
show any of the "modern" finder events.

   -----
And the modern Finder events have problems related to the fact that the
'aete' is unable to tell the whole story.

For the normal open event (not the old finder 'sope'), the scriptable
Finder (and MacOS Finder) aete resource says the direct object is a
reference
  (in AppleScript   open file "foo" of folder "bar" of disk "baz" of
application "Finder" <although the "of application "Finder"" part is
generally left off>).

In fact, Finder will accept those, or a list of those.
Or an alias or a list of aliases.
Or the odd File Spec object (created by AppleScript using  file
"baz:bar:foo") or a list of those.
Or real file spec descriptors (type 'fss ') or lists of those.
And, in testing, people tend to find that it will also take pathname
strings and lists of those.  But that's deceptive...that comes from a
'TEXT' to 'fss ' coercion provided by the common Scripting Addition "Jon's
Commands" (one of the few I run beyond Apple's set).  But that fails when
the script moves to a machine lacking Jon's Commands.

And, finally, Finder will accept a list of any combination of the above forms.

   -----
The writer of the 'aete' would have been able to say
reference to a file (what was indeed said, a lie because it leaves out the
other forms)
list of references to files   (a lie, since the list isn't needed if there
is only one)
anything    (a lie, since the things accepted are far fewer than "anything")
list of anything (a lie as above)

But the 'aete' is unable to express the truth, which is the case with many
many 'aete' entries.

   --John  (who managed to write Frontier "glue" to deal with the
scriptable Finder while not breaking scripts which used Frontier's original
Finder glue, but it wasn't easy...and MacOS 8 broke it slightly)
--
John Baxter   jwblist@olympus.net      Port Ludlow, WA, USA
Give a man a fish and you feed him for a day.  Teach him to fish,
and you get rid of him for the weekend.

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch