Re: List of aliases contains alias
Re: List of aliases contains alias
- Subject: Re: List of aliases contains alias
- From: Nigel Garvey <email@hidden>
- Date: Fri, 11 May 2012 08:21:39 +0100
Jim Skibbie wrote on Fri, 11 May 2012 02:33:01 +0000:
>Basically, the script tries to see if a file is already in the
>DroppedFiles list of aliases, and if it isn't, it adds it, but under OS
>X 10.6.8, it fails the condition and adds an alias to the DroppedFiles
>list even though it already exists in DroppedFiles.
>
>Here's an example:
>
>on open DroppedFiles
[…]
>The issue is that when I compare the variable DroppedFiles which is a
>list of aliases to x which is a single alias to see whether x is
>contained in DroppedFiles, in 10.6, this resolves to true even when it
>isn't. Is this type of comparison no longer valid in OS X 10.6?
It's come to light that, since 10.6, the list passed to a droplet's open
handler doesn't contain aliases but things called bookmarks («class
bmrk», no keyword), which behave like aliases but aren't aliases. So
your alias doesn't match anything in the list. Bookmarks have to be
coerced to alias or text before they can sensibly be compared with
anything in Applescript.
NG
_______________________________________________
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