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.
on open
DroppedFiles
-- the variable DroppedFiles is a list of aliases
--{alias "SnowLeopard Drive:some file.pdf", alias "SnowLeopard Drive:some other file.pdf"}
set
x to "SnowLeopard Drive:some file.pdf"
try
set
x to x as
alias
display dialog ((DroppedFiles does not contain
x) as string)
display dialog (((DroppedFiles as
string) does not contain (x as
string)) as string)
if
DroppedFiles does not contain
x then
display dialog ("I should not get here." &
return & return & "Files dropped: " &
return & DroppedFiles as
string) & return &
return & "File coerced to alias: " &
return & (x as
string)
end if
end try
end
open
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?
If I coerce DroppedFiles from a list of aliases to a string and do the same for x and then compare them, it seems to work:
if (DroppedFiles as
string) does not contain (x as
string) then
The other odd thing is that in Script Debugger, the condition resolves correctly, but if I save out the script as a droplet, the condition resolves first incorrectly (comparing aliases)
and then correctly (comparing strings).
Any help in this behavior would be appreciated!