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
Dropping a folder onto a closed standalone
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Dropping a folder onto a closed standalone
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
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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Dropping a folder onto a closed standalone
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
(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
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
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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode