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
I found the culprit, thanks to the excellent Xojo Remote Debugger … 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?