Regular and Droplet behavior in a Cocoa-Applescript application

Hi there,

This is my first post here, so I’d like to thank in advance for your time.

I created a very simple Applescript application with Applescript Editor, and this application had both behaviors opening with a double click (as usual) or by dragging a file onto its icon (as a droplet). Then I needed to use a more complex dialog box so I moved to Xcode 3.2.6 and try with a Cocoa-Applescript Application. Everything works fine so far, except for the droplet behavior.

I tried to add the “on open/end open” at different points in the *Delegate.applescript but with no success. Is there a way to have both behaviors or I just simply can’t have both?

Thanks!

It’s a bit more complex in a Cocoa-AppleScript app. You need to implement an application_openFiles_(theApp, fileList) handler, and you also need to add entries to the app’s Info.plist file for the types of files and/or folders you want to accept.

In Xcode 3.x you make the changes in the Properties tab of the Target dialog (choose Edit Active Target “” from Xcode’s Project menu). Add entries, and enter at least an extension (no dot) and change the Role to Viewer for each.

It worked perfect!

Thanks for saving me hours! :slight_smile: