Can't get files dropped on window to work

Mark and Shane,

I have enclosed the Applet and test files (in a file named “Applet & test”) I used when I had the problem.

When I drop files on the window show below nothing happened. The script works correctly when I drag files on the Applet, but not when I drop them on the window. The script is an “Application (enhanced)” stay open Applet. This same applet works when it is “not” a “stay open” applet. The Applet takes the names of all the files dropped and merges these names into a single string with each file name separated by a return character.

The window turns red when files are dragged over the window so the applet seem to be aware files are being drug over it. When I release the mouse button the red goes way but nothing happens. I put a display dialog in the applet to see if the AppleScript was even run after I released the mouse but the display dialog was never executed.

I’m not sure if this is not working, or if I am doing this wrong.


Applet & test (1.5 MB)


I can reproduce the problem. It seems to be related to the use of the wildcard extension. If I provide specific filename extensions it works. Shane and I will sort this out for the next build.


Note also that its best to sign applets you share with us as they cannot be opened on other machines if they are not code signed.

I also notice that Script Debugger’s validation files dropped into a script window also rejects all files when the wildcard extension is used. The Execute Open handler option is not enabled.

I don’t have any way to code sign. Is that going to be a problem?


No, we can work around it.

I’m just curious if you know the reason for this. I can understand security concerns with running an applet. But why are we no longer allowed to simply see the code in an applet unless it is code-signed?

I’m very glad we have another option if the applet was created with SD.

This is all happening before Script Debugger is given an opportunity to open the applet. The System Security & Privacy preferences panel used to give you the option of opening any application. In on Sierra and that option is gone.

You can still drag the main.scpt file out of the applet bundle and open that.

I realized it wasn’t an SD issue. I understand security providing protection external apps being run. But this isn’t launching an app. It’s editing a file with SD or SE. I just don’t understand security enough to know why we need protection from that, especially when the OS can easily identify it as a script app. I was just curious to know if Apple has provided any rationale for this.

I’m just speculating here. The act of opening an application as if it is a document is very AppleScript specific. I can’t, off the top of my head, think of any other tools that do this. Apps are normally the immutable result of a build process. I think the signing restriction is simply a case of Apple not really paying much attention to it.