I have some utilities that accept file dropping from Finder using (when dragging a file over the app this highlight):
Sub OpenDocument(item As FolderItem) Handles OpenDocument
if item <> nil then
dim b as Boolean
b = CopyFileOrFolder(item)
end if
// Quit
End Sub
With the new API I used the new event
Sub DocumentOpened(item As FolderItem) Handles DocumentOpened
if item <> nil then
if OpenDB(item) then
MW.ShowData()
end if
end if
End Sub
But doesn’t work, when dragging a file over the app it doesn’t highlight and the app is not launched.
I recently updated to Catalina, using xojo 2023 r1.1
Something is wrong with your filetypes. This has nothing to do with the code.
i did not specified any filetypes.
I tried to add a File Type Group with MacOS types = ??? but nope.
Handling filetypes is obnoxious. I don’t remember what is needed to make the app accept files. This is a working filetype:
Old apps work but if compiled again not work anymore.
I just created a clean new app.
The only code is
Sub DocumentOpened(item As FolderItem) Handles DocumentOpened
if item <> nil then
System.Beep
end if
End Sub
From Finder if dragging a file over the build app it doesn’t highlight.
The System.beep never happens
Show us your filetype. I made a new app, copied the filetypes over and DocumentOpen fires fine:
Maybe I need something in “extension” like “???” ?
Greg_O
(Greg O)
August 12, 2023, 11:10am
8
Go to the menu at the top, select Special/Any and then in the macOS section, select View or Edit depending on what your app does. See if that helps.
FWIW, the fact that there is a UTI in there means that your app is only looking for files with that identifier. Everything else is being ignored.
Greg_O
(Greg O)
August 12, 2023, 11:14am
9
You might also try
public.data
in the UTI field
public.content
in the “conforms to” field
I’ve mentioned this before, but on macOS, you can drag items from Finder into that editor and it will get the correct settings from the system.
When you tried do you drag any file? or just the .MailArchiveXLicence?
Thanks Greg but it doesn’t work for me.
Greg wrote:
drop your file (the file you want to read / write) onto the FileType and Xojo will fill the interface (FileType) for you if you are in MacOS.
I’ve used just the license file.
My purpose is open any file.
Thanks Emile, but my App would be able to open any file.
Yup, any doesn’t work. I compared the any handler in Mail with the one in your test app.
Item 6 in Mail looks like the any handler. But Xojo needs a name.
Thanks Beatrix, today is Saturday but will be nice if on Monday any one from Xojo staff could tell us if is not longer possible to open (dragging from Finder) any file with the new API Xojo made app.
Enric Herrera:
I have this one with the Identifier field empty, Role set to None, and the Conforms To field actually set to “, public.data” (without the quotes).
I think this works, although the leading comma and space may be an error.