dropping to the Finder

Björnke von Gierke bvg at mac.com
Fri Feb 26 18:02:26 EST 2010


i might have an idea for you. Be warned, it's a dirty workaround. and only halfway there. seriously, i'm not fond of it.

I tested this:
on mousedown
   set the dragdata["files"] to "/Users/bvg/Desktop/GreeceMap.jpg"
end mousedown

Note that the file does exist. But, when I start a drag from that button, the file will be _duplicated_ in the finder wherever I drop it, including proper renaming (when dropped onto the desktop, a file "greeceMap 2. jpg" is created). Note that other OSes might behave differently (might depend on the dragAction?). However, there is no easy way to actually know _where_ the user dropped the file, as you noticed. So what you can do is this:

The user selects the files for download, and then you download the file into a temporary hidden location (eg. temp folder), and then, when you're finished downloading you let the user start a drag action, while setting your dragdata["files"] to the temp files.

Another Idea i just had when rereading my post: all files in mac os have a unique id, independent of name and place in the folder hierarchy. I think there's command line and other ways (applescript) to query that id. you could let the user drag a fake file of which you _know_ the id, then find out where it's now at in the finder... that'd actually work! No idea how to querry the id tho.


-- 

official ChatRev page:
http://bjoernke.com?target=chatrev

Chat with other RunRev developers:
go stack URL "http://bjoernke.com/chatrev/chatrev1.3b3.rev"




More information about the use-livecode mailing list