Accessing Resource file on macOS

Good morning (o;

I use CopyFiles in the build process to copy several folders into the Resources folder.

To access a single file in one of the directories I use:

Var f As FolderItem
f = SpecialFolder.Resource("uppercase/A.nc")
If f <> Nil Then
  Var input As TextInputStream
  input = TextInputStream.Open(f)
  StatusText.Text = input.ReadAll
  input.Close
Else
  MessageBox("File doesn't exist.")
End If

But TextInputStream.Open(f) gives an IOException. And when I look at the variable f, it replaced the “/” in the path to “:”

file:///Users/me/Develop/Xojo/PipeWriter.debug.app/Contents/Resources/uppercase:A.nc

If uppercase is a folder you should do this:

f = SpecialFolder.Resource("uppercase")
if f<>Nil then 
f = f.child("A.nc")
End If
...

Yeah…just figured it out myself:

f = SpecialFolder.Resources.Child("uppercase").Child("A.nc")