applescript open action and quarantine items

Hi,

I have a simple applescript droplet, but not all dropped files are being passed to the open handler. It appears that the problem is with files that have the com.apple.quarantine attribute set. If I drop a single file with this attribute set, the droplet runs as expected. If I drop multiple files, the ones with the com.apple.quarantine attribute are silently exclude from the list. Here is a sample the exhibits the problem:

open theDropped
display dialog “Dropped " & (theDropped’s length) & " items”
end open

Say I drop five files on the droplet, and three of them have the quarantine attribute set, the droplet will pop a dialog saying “Dropped 2 items”. If I drop one file WITH the quarantine attribute set it will say “Dropped 1 item”. I have confirmed by looking at “theDropped” that it is the items with the quarantine attribute that are not making in on the list. If I first clear the quarantine attribute using xattr, everything works as expected.

How can I make the open handler see these “quarantined” files? I know I can preprocess the files to remove the attribute, but that just avoids the real problem.

Thanks!

Jim

Model: MacBook Pro
Browser: Safari 5.1.1 7535.51.22
Operating System: Mac OS X (10.7)

The script doesn’t work at all without a minor modification:

on open theDropped
	display dialog "Dropped " & (theDropped's length) & " items"
end open

Other than that, you can make the script call xattr every time something is dropped onto the droplet using the “do shell script” command:

on open theDropped
	do shell script "xattr " & theDropped
	display dialog "Dropped " & (theDropped's length) & " items"
end open

Hope this helps.

Thanks for the response. I don’t see how this fixes the problem though. The variable theDropped should contain a list of all the files that were dropped onto the droplet. The problem is that dropped files that have the quarantine attribute set never make it onto the list for some reason (this only happens when multiple files are dropped onto the droplet). Since they never make it onto the list, the handler doesn’t even know about them, and therefore, can’t call xattr to change them. Am I missing something?

Thanks!

–Jim