drag drop of files and folders
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
drag drop of files and folders
So Smart Software has a great tutorial on drag and drop. I've learned a lot from this tut and have implimented drag and drop file handeling very well. I've also implimented drag and drop folder handeling in another test program. What I cant figure out, is how to get both working together. Like if a file and folder were both dragged to my program and I wanted to copy the file to one url and the folder to another url.
Hi keyless,
unfortunately there is nothing like: the dragdata["folders"]
Everything is listed in: the dragdata["files"]
I usually check for files or folders in my handlers like:
A bit unhandy, but works fine for me 
Best
Klaus
unfortunately there is nothing like: the dragdata["folders"]
Everything is listed in: the dragdata["files"]
I usually check for files or folders in my handlers like:
Code: Select all
...
repeat for each line i in the dragdata["files"]
if there is a file i then
## do stuff with files...
end if
if there is a folder i then
## do stuff with folders...
end if
end repeat
...

Best
Klaus
Last edited by Klaus on Fri Apr 11, 2008 10:36 am, edited 1 time in total.
Test it yourself. Example code for a field:
Code: Select all
on dragDrop
put the dragData["files"] into me
end dragDrop
on mouseEnter
set the acceptDrop to true
end mouseEnter
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Thanks Klaus, I think the "If there is folder" part of your code will work nicely in a loop that I already have.
@ BvG - Yeah, I already have that part down, the drag drop was never the issue, I just didn't know it was as simple as "If there is a folder", to deal with the folders. The documentation makes it seem the dragData only takes in files.
Thanks for the help.
@ BvG - Yeah, I already have that part down, the drag drop was never the issue, I just didn't know it was as simple as "If there is a folder", to deal with the folders. The documentation makes it seem the dragData only takes in files.
Thanks for the help.