I’m trying to setup a FileType for a DropObject so it will only accept a folder and not a file. I’ve had this working in the past, but the settings I used then don’t seem to be working now. The canvas I’m using to test is accepting any file drop. Does anyone know what the latest way to do this is on a Mac?
I’m on Xojo 2013 R3, Mac OS X 10.8.4, compiling for Cocoa (maybe that’s the problem, I think these settings have worked in Carbon in the past)
Here’s what I have in my FileType:
Display Name: special/folder
Object Name: Folder
MacType: fold
MacCreator: MACS
UTIs: public.folder
I’ve also tried without the UTI and with just the UTI and had the same results.
In the Open event for the canvas, I have, “me.AcceptFileDrop(FileTypes1.Folder)”
And in the DropbObject event, I check for FolderItemAvailable and then display the path of the folderitem in a text area. No matter what I drop there, the path is displayed in the text area.
I wanted to tell you to put Dale’s code in a #TargetCocoa (check the real spelling and how to use it in the docs) block, so it will not do a duplicate work o Windows / Linux and I forgot8
Thanks, Emile. That’s good advice, although this happens to be a Mac-only app. It would, indeed, be nice if the docs mentioned the workaround for the folders. I’ll file a feedback report.