Folder Drag and Drop
So far our project only deals with file drops.
It checks to find out if any of the files dropped are images and then adds them to the list.
put item 1 of dragData(x, "hfs ",type ) into tFileType
if AltIsGraphicFile( tFileType,tFilePath) then put CR& tFilePath after tImageList
We will now try and find out if there are folders in a drop. If there are
dragData(x, "hfs ",type ) with return
fold,MACS where x is the number when we loops thorugh all the dragFlavors. So we can:
put item 1 of dragData(x, "hfs ",type ) into tFileType
iftFileType ="fold" then put CR&listFolderImages(tFilePath) after tImageList
if AltIsGraphicFile( tFileType,tFilePath) then put CR& tFilePath after tImageList
We do not have a function
listFolderImages yet but we should be able to look at the script of our
Add Folder... button to help.
function listFolderImages pFilePath
if last char of pFilePath is not colon then put colon after pFilePath
put Dir (pFilePath,false,true) into tfileList
repeat with x = the number of lines in tfilelist down to 1
if not isGraphicFile(line x of tFileList) then delete line x of tfilelist
end repeat
return tfilelist
end listFolderImages
We now should have a mouseDrop script that handles drops of mixed multiple files and folders. You should give it a test.