I've been using a script for some time and decided to add an open handler to it so that the user could use Drag & Drop in addition to Select & Launch. Imaging my surprise when this script ...
on open dropList if (count items of dropList) > 1 then error "You may Drag & Drop only one file." end open
responded by opening a web page in Safari. I had Dragged & Dropped a .webloc file onto it. I want the script to ignore . webloc files ... and many other files that don't make sense to the script.
Next I tried this script ...
on open dropList try repeat with dropItem in dropList set dropAlias to (dropItem as alias) tell application "Finder" to name of dropAlias display dialog the result end repeat on error errText number errNr "Error = " & errNr & return & errText display dialog the result end try end open
hoping to see an error message. But there is no error message! If dropList contains a .webloc file, the script simply quits without error when it is encountered in the list and Safari opens its web page.
The problem occurs even with this very simple script ...
So it seems to be impossible to work-around it. This seems to be very undesirable buggy behavior. The open handler should not do this!
|