Page 1 of 1

Dragging and dropping multiple files into a datagrid

Posted: Tue Oct 24, 2017 12:25 am
by PoLyGLoT
Hi all,

I want to drag and drop multiple files into a data grid. These files would come from a folder on the local computer, not from the livecode application itself. I then want those files locations to put put into a column into the datagrid. Any thoughts?

Is it correct to start with "dragEnter"?

Code: Select all

on dragEnter 
set the acceptDrop to true
##put file location into DataGrid column X
end dragEnter

Re: Dragging and dropping multiple files into a datagrid

Posted: Tue Oct 24, 2017 2:26 am
by PoLyGLoT
Hey y'all,

I figured out how to get the info I want. Now I am just trying to figure out a way to open each file and get some meta data for each file!

But here's the code I used to list all the files on a drag and drop:

Code: Select all

on dragEnter
   set the acceptDrop to true
   repeat for each line theLine in the dragData["files"]
      add 1 to currentLine
      put theLine into myData[currentLine]["File Location"]
   end repeat
   set the dgData of group "DataGrid" to myData
end dragEnter