Re: are finder items items? what is a vector?
Re: are finder items items? what is a vector?
- Subject: Re: are finder items items? what is a vector?
- From: Brennan <email@hidden>
- Date: Sat, 26 Dec 2009 10:24:41 +0100
On 25/12/09 at 14:48, Axel Luttgens wrote:
The "is in" operator is applied here to lists: a list contains another
one if the latter is a sublist of the former. The operator thus
expects two lists as operands.
The error message tells that the "Finder item to list" coercion is an
unknown operation.
So, being explicit:
if {i} is not in selection then
allows to avoid that error message.
But... above test appears to be always true.
Yes, I got that far myself, but many thanks for explaining wtf
is going on.
And indeed, one is now
facing the fact that i, being the loop variable of a "repeat with
variable in list" loop, is a reference of the form "item x of fitems",
not the xth item of fitems itself. {i} is thus a list containing a
reference, not a list containing a Finder item.
As a result, one needs:
if {contents of i} is not in selection then
and the script now behaves as expected.
Great! Thanks to all for the responses, which have been usable
and interesting.
--
Brennan Young
There are a large number of ways of skinning a cat, and at a
certain point you have to agree that the skin is on the outside
and the cat is on the inside.
- Gregory Bateson
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden