How to enable launch by DnD with a *folder* (not a file)

I’ve been writing Applescript code for years, automating things ranging from simple image manipulation to backup of encrypted journals in MacJournal.

Now I want to replace the dialog which asks me for my passphrase before mounting an encrypted disk image (sparsebundle) in the Finder. Ever since I moved to El Capitan (where I still am) I’ve missed the old “Show typing” checkbox with long passphrases, and repeated googles have not turned up any system extensions that bring it back. So I figured I’d roll my own.

I’ve got everything defined, hooked up and working, except for app launch. I want to be able to drag ‘n’ drop my sparsebundle to the app, and I can’t figure out how to achieve this. I’ve managed to find application:openFile, and it’s working, but only with files – and of course sparsebundles are folders.

Is there any way to get my app to accept folders being dragged onto it?

I’m using XCode 7.3, in case that makes any difference. I tried to upgrade my XCode today and got told that the latest one won’t run on El Capitan.

Have you tried declaring a “Document Type” in the info.plist for “public.folder”?

Many thanks Bentoms, that did the trick :slight_smile: Happy ski addict I am! :slight_smile:

In case this helps future travellers, I set the Document Type Name to “AFolder”, Handler Rank to Default, I created Role and set it to Viewer, I created CFBundleTypeExtensions and set the String to * and I created Document Type Extensions and set the String to ****

No idea whether some of those are unnecessary.