Can’t Open File my App creates

I’m on Mac OS 12.4 Xojo 2022.R1.1 on an Intel Mac

But this needs to work back to High Sierra and Windows 7-11

I am creating a custom file type and Saving the file. If I double click on the data file the app opens and opens the datafile just fine.

If however if I try to open the app with the Open Dialog class I can’t select the file… It is greyed out! How can if fix this besides allowing the file one to per any file and then checking if it is a .PLC after?

The Save and Open methods are show below… Both use the same File Set Filter!

Here is the save method:

Public Function Save(File as FolderItem = Nil) As Boolean
  If File Is NIL then
    Dim dlg As New SaveAsDialog
    dlg.InitialDirectory = App.Prefs.PLCFolder
    dlg.PromptText = "Save Fermentation Data"
    If Not (theData.DataFile Is NIL) then
      dlg.SuggestedFileName = theData.DataFile.Name
      dlg.Title = "Save Fermentation As"
      dlg.SuggestedFileName = theData.Title
      dlg.Title = "Save Fermentation"
    End if
    dlg.Filter = PLCFileSet.PLCSaved
    File = dlg.ShowModal
    If File Is Nil Then 
      Return False
    ElseIf File.Exists then 
    End if
  End if
  Return True
End Function

Here is the Open Method:

Sub Action() Handles Action
  Dim dlg As OpenDialog
  dlg = New OpenDialog
  dlg.InitialFolder = App.Prefs.PLCFolder
  dlg.Filter = PLCFileSet.PLCSaved
  dlg.ActionButtonCaption = "Select PLC File"
  dlg.CancelButtonCaption = "Cancel"
  dlg.SuggestedFileName = ""
  dlg.Title = "Select Saved PLC Data (.PLC) File(s)"
  dlg.PromptText = "Select Select Processed PLC File"
  dlg.MultiSelect = False
  Dim F as FolderItem = dlg.ShowModal
  If F is NIL Then Return
End Sub

I’ve seen this
Nothing seems wrong in the apps I’ve seen this occur
The App’s plists are all OK and document types are OK

What I HAVE found works is, in the dialog, right click & select RENAME
Dont actually rename the file
That seems to tweak thing so you can select the file

I truly have NO idea why it is this way - but I have seen it

One possibility is that spotlight & metadata indexing simply hasn’t completed and so it doesnt realize that the file can / should be openable

It just started working on it’s own, so I think your hypothesis is right.


meta data collection can be doggedly slow sometimes

I’ve heard that if the iCloud feature is turned on it can cause such issues because the Documents folder isn’t where you think it should physically be. The solution is to turn off iCloud sharing.

I’ve also heard that saving a file to the desktop and then dragging it to where you actually want it forces it to show up.