I have a quick question for you. I can drag and drop files onto an app window – and that works without any issue. Yet, when I try to drag and drop the same files onto the compiled program’s icon, nothing happens. (I am working with MacOS.)
Here’s what I’ve done so far…
Added the File Types Group (to state the type of files that can be opened.)
Added drag and drop to a canvas. (That works.)
Added a documentOpen() event at the App level.
I can drag and drop files on the canvas without issue, but drag and drop onto the app icon is still not allowed. Ideas? Suggestions?
You have to set the file type group elements correctly. First you have to setup the correct identifier and conforms to items. Once you have done that you need to configure the Type on the right hand side to File and Role to View or Edit. The Rank can be default if it is your type or alternate if you can open it but it really belongs to someone else.
EDIT: I do not have Role set to Execute, I’ve tried View and Edit. They get set to None when I run, regardless.
Is this maybe a bug with 2021r2.1 or am I doing something wrong? Can it be fixed via Info.plist? My Info.plist file after compilation has no keys for UTExportedTypeDeclarations or CFBundleDocumentTypes, but it does have UTImportedTypeDeclarations:
Got it working for Excel files. I copied Excel’s Info.plist, removed everything but UTExportedTypeDeclarations, CFBundleDocumentTypes, and UTImportedTypeDeclarations, saved as XML (Excel’s is binary), and dragged it into the IDE.
@Julia_Truchsess if you have this trouble again, on a Mac, you can drag and drop files into the FileTypeGroup and it will go look up the correct properties for the item. I would bet that it would work properly that way.
That’s a great tip, thanks, @Greg_O! It doesn’t however, solve what seems to be my root issue, which is that as soon as I run the program, Role reverts to None for all my FileTypes.
Ok, so that bug has to do with changing the role not marking the file type group as needing to be saved. Make your changes, change the name of something and then change it back. (Manually, don’t use undo). Then save.