I have successfully developed a combined application and droplet using Script Editor using on run and on open handlers. Within the on run handler, I use display dialog to remind the user that it’s really a drag and drop application.
However, it appears that Applescript Studio requires choosing one or the other, not having both simultaneously. I have the following handlers:
on launched theObject
on open theFiles
on will quit theObject
Within the on launched handler I use the same display dialog reminder. So far so good, but when I try to drag and drop a file on the built application, the app does not highlight meaning that somehow it does not recognize itself as a drag and drop application via my on open handler.
When I create a droplet, Applescript Studio creates empty on open and on idle handlers and that’s all.
Further, unlike the double-clickable app version of Studio, even though I do have a Window in my droplet project, no window shows … I call display dialog attached to this window, but no window shows. So whatever hidden code in the double-clickable app shows this window successfully, that hidden code is apparently not present in the built droplet project.
programming AppleScript Studio is quite different from plain AppleScript
To show a window either check “Visible at launch time” in NSWindow Inspector of Interface builder or
use a awake from nib or will finish launching handler adding the line
show window "myWindow"
.
All Interface elements must be properly connected to the script