Page 1 of 1

Dropping a folder onto a closed standalone

Posted: Fri Oct 21, 2011 12:31 pm
by Chris
Hello folks -

I'm hoping this one is easy, but I can't seem to find the answer anywhere. I want to be able to open a standalone by dropping a folder onto it. Now actually that bit is easy (on Mac at least) by including "folder" in the pList data. But how do I pass the folder path to the stack script so that I can actually act on the folder?

I've tried using "the dragData["files"]" in the preOpenStack script, but that seems to be empty.

Any ideas?

and then... how do I do it in Windows???

Chris

Re: Dropping a folder onto a closed standalone

Posted: Sun Oct 23, 2011 10:30 pm
by Mark
Hi Chris,

On Mac, use the AppleEvent handler. Here's an example.

On Windows, you might be able to use the $0, $1, $2... variable.

Kind regards,

Mark

Re: Dropping a folder onto a closed standalone

Posted: Sun Oct 23, 2011 10:37 pm
by Chris
Brilliant! Thank you!

(Actually, your sample script anticipates another problem I have. Elsewhere in my project I need to be able to identify valid audio files. The "file type" external that is alluded to: where could I find such a thing? Or should I just roll my own function by looking at filename extensions?)

Thanks again,

Chris

Re: Dropping a folder onto a closed standalone

Posted: Sun Oct 23, 2011 10:55 pm
by Mark
Hi Chris,

File types are really just codes that are somewhere in the desktop database on Mac. These days, a file may very well have an incorrect file type or no file type at all. They are no more reliable than the file extensions. On Windows and Linux machines, such a thing like file type doesn't even exist.

You might check the file type if no file extension is present or if the file extension is insufficiently specific. However, you may be unable to detect a (correct) file type.

If a file type is present, you will find this info in the detailed files function.

Kind regards,

Mark