I need to open a text file with a custom extension of “.irr”. I added it to a FileTypes declaration as shown
And I try to open it with the code
f = FolderItem.ShowOpenFileDialog( FileTypesText.All )
The file is always grayed out in the OpenFileDialog. I tried dragging and dropping it onto the application, no luck.
How can I get Xojo to recognize this text file?
You have used .all and so it will give you all.
Here, I made a file type of the text files I want to open, and called it MyTextTypes
Note the role is set to edit:
Then this code works:
dim f as folderitem
f = FolderItem.ShowOpenFileDialog( FileTypeGroup1.MyTextTypes )
I tried your suggestion, the OpenFileDialog continues to show all “.irr” files grayed out.
This issue has been plaguing me for two years. Nothing I have tried will result in OpenFileDialog allowing access to “.irr” files. If I change the “.irr” to “.txt” on the file, OpenFileDialog will grant access. Do I have to feed the troll?
Found it!
Thanks to your screen shot, I deleted the Identifier “public.text”. Now the “.irr” files have passed the OpenFileDialog troll.
Here is the working FileTypes definition
Thank you for your help!