Nigel, et al.-
Thanks to all for pointing me in the right direction. Sorry, but I've come to the Snow Leopard party a bit late. Now that I understand that the class of the variable from 'on open' is «class
bmrk»
and not a list of aliases, this makes much more sense. Basically, today I have a Leopard and Snow Leopard machine side by side. If I run the below script by dropping the same file that is defined for the variable x on this app, I get the following results:
on
open
DroppedFiles
set
x
to
"Macintosh HD:Users:schawk:Desktop:GraphicElements.pdf"
try
set
x
to x
as alias
display dialog
((DroppedFiles
does not contain
x)
as string)
end
try
end open
In OS X 10.5.8 in Script Debugger v4.0.9: false
In OS X 10.6.8 in Script Debugger v4.5.7: false
In OS X 10.5.8 as application: false
In OS X 10.6.8 as application: true
Someone posted about Script Debugger and I think there may be an issue there. When I have an 'on open' handler variable, in Script Debugger on 10.6.8, it says the class is list and it is a list of aliases, but
when the same script is saved out and run as an application, the class is «class
bmrk»
and not a list. I think this is a bug in Script Debugger and I'm cc: ing Mark Alldritt regarding it.
Is there a way to coerce the «class
bmrk» to a list of aliases? If not, my plan is to just loop through the bookmark variable and build a list of aliases to keep the functionality of how 'on open'
used to work.
Thanks.
Jim
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