Re: FMP 6.0v3, OS X 10.2 and AppleScript -> Broken
Re: FMP 6.0v3, OS X 10.2 and AppleScript -> Broken
- Subject: Re: FMP 6.0v3, OS X 10.2 and AppleScript -> Broken
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 19 Sep 2002 07:39:42 -0700
On 9/18/02 11:58 PM, "Simon Forster" <email@hidden> wrote:
>
On Thursday, September 19, 2002, at 01:06 AM, JoePostscript wrote:
>
>
> I don't like the use of "OF" in there, no matter
>
> what OS or FM version...
>
>
Hmm. If you check the FileMaker Pro AppleEvents reference database
>
you'll find an example which uses this construct.
>
>
> Why not simply...
>
>
>
> count windows
>
>
>
> count every window
>
>
I have tried these. These fail too.
They would. 'count of' is a legal form of 'count' anywhere in AppleScript.
The 'of' doesn't do anything except allow you to use an English construction
that "feels" better in some circumstances. It actually disguises the fact
that 'count' is an event, not a property like 'length', so if you don't
approve of fooling yourself you'd avoid it for that reason. But it doesn't
do anything: 'count of' simply is an alternative wording of 'count' - it's
the same event. In both cases, it's something you should usually put in
parentheses:
count {"a", "b", "c"} - 1 > 0
--> ERROR; Can't make {"a", "b", "c"} into a number
(count {"a", "b", "c"}) - 1 > 0
--> true
count of {"a", "b", "c"} - 1 > 0
will actually compile for you into
(count of {"a", "b", "c"}) - 1 > 0
--> true
so you don't get the error: probably since the 'count of' is a sort of
coercion anyway it figures it knows what you're doing and coerces to the
correct syntax. It must make clear that the very next construct is the thing
you're trying to count, whereas the first example, without the parentheses,
is construed as
count ({"a", "b", "c"} - 1) > 0
which of course is a syntax error. So always use parentheses with 'count'.
In any case, if 'count of' is broken, it does mean that 'count' is broken,
in the application context where you find yourself.
--
Paul Berkowitz
_______________________________________________
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.