Possibly dumb question: Is there a way in a droplet application to bypass OSX’s eagerness to make applications resolve aliases and instead treat an alias item as an item (i.e. move the alias to the trash) without first resolving the alias and moving the original to the trash? as in:
on open filelist
repeat with aFile in filelist
tell application “Finder”
if (kind of aFile is “Alias”) then
move aFile to trash
else
–
end if
end tell
end repeat
end open
or
on open filelist
repeat with aFile in filelist
if alias of (info for aFile) is true then
tell application “Finder” to move aFile to trash
else
–
end if
end repeat
end open
run as a compiled script from the script menu, either works just fine.
I’m pretty sure that one of the AppleScript engineers (Chris Nebel) has acknowledged this as a bug but it’s hard to say when it might be fixed. I don’t know of a way to work around it but there might be some way to use the shell to do it.
on open
tell application "Finder"
activate
repeat with aFile in ((selection) as list)
set Doc to aFile as text
if (class of (item Doc) is alias file) then
delete (item Doc)
else
-- <other stuff>
end if
end repeat
end tell
end open
Yup, that works just fine! I was working on something similar but I always hesitate to rely on selected files. For now, it looks like the only solution.