Re: Three simple FMP questions
Re: Three simple FMP questions
- Subject: Re: Three simple FMP questions
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 09 Jul 2001 08:04:03 -0700
On 7/9/01 12:31 AM, "John W Baxter" <email@hidden> wrote:
>
At the Apple event level, there is not much difference between a single
>
thing and a list containing just that one thing. All the application
>
programmer need do is ask for a list, and if just the one thing was
>
presented, it will be coerced* by Apple Event Manager to the list of one
>
thing. It was easy early on (and FileMaker scripting goes back to the days
>
of "early on") to forget that AppleScript does care about the difference.
<big snip>
>
I think FileMaker's dictionary could be improved from what it is...I don't
>
think it can contain the whole truth, just as Finder's can't.
Thanks, John, for the detail (snipped). The Finder, of course, is not
perfect but tends to err on the side of "usability" with silent coercions
instead of errors. If the Apple Event Manager coerces a single item to list,
that explains how this came about. Thank you. It's too bad the AppleScript
implementation was never changed to coerce a single record to list, too. It
appears that the class of a single cell's contents _could_ be a list (if
it's a field from a related record, as Malcolm Fitzgerald has written me) so
in rare circumstances checking the class of item 1 might not be good enough
- you'd have to check the class of every item. It would be much better if
you could rely on the class of 'every record' to be a list, even where
there's just one. 'every record' is an AppleScript synonym for for 'records'
which _is_ defined in the FMP Dictionary as a plural of 'record' and should
always be represented by a list.
--
Paul Berkowitz