I’ve discovered that when a combination of files and folders are dropped on an On Open
applet, the items are processed twice. First, the folders are processed, then the handler executes again, processing the files. This makes it difficult (impossible?) to get a single list of all the items dropped before further processing.
For example:
on open droppedItems
say (count droppedItems)
end open
If the following five items are dropped…
…the script will say “Two Three”, not “Five”. It runs twice: first for the folders, then for the files.
Interestingly, this is not the case while using SD’s Script > Execute > Open…. When debugging using Open…, the results is “Five,” as expected and desired.
I can’t figure out a way to combine the two passes into a single list before passing it on. For various reasons having to do with my actual app, handling the input in two separate batches is undesirable.