GetOpenFolderItem( FileTypes.myFileType) always returning nil on Windows

In my App FileOpen menu I have this code:

f = GetOpenFolderItem( FileTypes.myDocument )
Openmyfile(f)

When running the app, I get the open folder item dialog but after selecting a file I always get nil. Needless to say that this code has worked for a decade and still work on macOS as usual. I am using Xojo 2016r1.1 and Windows 10 for testing.

The Filetype is defined as:

myDocument
Display name: My Document
Description My Document
UTI Identifier: com.me.appname.document
Conforms to: public.data
Extensions: myext
Mime Type:
Os Type: mytype
UTI Type: Exported

Anyone has sen that problem?

I just tried with less keys, and it works just fine :

Display name : My Document Extensions : .myext //note the dot UTI Type : Exported (default)

dim f as FolderItem = GetOpenFolderItem(FileTypes1.All) if f = nil then msgbox "nil" else msgbox f.shellpath end if

I am not sure Windows uses the UTI information. Apparently removing the identifier does not hurt.

Since there is no mime type I do not think it is necessary to claim any conformity.

Try with the extension set to .myext (including the period)

I found the culprit, thanks to the excellent Xojo Remote Debugger :slight_smile: … without it I believe it would have been quite difficult since the origin of the problem is quite weird. It comes from the following lines in a TextArea.Open event:

Dim n as NSTextViewMBS = me.NSTextViewMBS
n.AutomaticQuoteSubstitutionEnabled = False
n.AutomaticDashSubstitutionEnabled  = False
n.AutomaticDataDetectionEnabled = False
n.AutomaticLinkDetectionEnabled = False

Ok, my bad, by using #If targetMacOS the problem has disappeared but I don’t understand how that can cause other functions to fail later, I mean what is the relation between NSTextViewMBS and opening files? Actually opening a file directly was failing as well. Weird isn’t it?