Drop apps: Why does AS split the selection and run twice??

Why does Applescript sometimes split up the selection and run twice?

Sorry if I missed an existing post on this: After searching other forums and posting to the Apple developer forum, I have not found an answer. I’ve seen the question of why AS runs twice (not necessarily related to a drop app), asked but not answered, in several locations.

I have this down to a single command (display dialog) to the Open handler:

on open these display dialog the number of items in these (* -- To display each item: set k to 0 repeat with anItem in these set k to k + 1 set s to anItem as text display dialog "Item " & k & " = " & s end repeat *) end open
SOMETIMES the app runs once, as I’d expect, and the dialog displays the number of items I dragged, but SOMETIMES it splits them up, the app will run again, displaying the remainder of the dropped items. Why?

¢ It has run once, as expected with different kind files dropped, but run twice with same kind files dropped. I have made a multiple selection that runs once, added another file of the same kind already in the selection, and it runs twice. File kind doesn’t seem to explain it.

¢ I have dropped 8-10 files and it runs once, and just two files and it runs twice. Number of items doesn’t seem to explain it.

Many thanks in advance for any insight into this!

That is a pitty. I think Apple changed some things so that folder actions (and drops) rely on all the same thing. Mainly I think they use the watch folder thing with the launchd. Not sure though.

I don’t see any obvious pattern. That’s one very nasty bug…

Except the one I’d forgotten about, and has been an issue since well before Yosemite. You get multiple batches if one or more of the files still has its quarantine bit set.

Thanks Shane. I take it from your reply that this has happened to you. Sometimes you can think you’re the only one experiencing stuff like this.

And thanks kel1, too!