FileType question

Your appication allow the user to choose and open a preference file ?

Maybe a stupd question, but I am surprised. Preferences files are - for me - service fils, not user files (even if the user can change its contents: the application deals with the I/O, not the user).

Nota: I always have a revert to defaults button for my preferences.

Oh…

Try using the name of the object, without the quotes. It’ll be something like:

FileTypeGroup1.SCPF

I have 3 files, a document file, a best times file and a preference file. When I changed the UTI none of them worked. I changed the code for the pref file so I could choose where to save it as I was troubleshooting this mess. Using FileTypeGroup1.xxxx works when I have the user explicitly save or open these files, but trying to open or save a file in a SpecialFolder like Preferences is still broken. This worked for years and now it doesn’t see these files. I don’t see a way to use FileTypeGroup1.xxxx with SpecialFolder to automatically open and save the files that are “service” files.

Preferences Files goes to Special.Preferences. Why are-you using a dialog to open them ?

Can you define Service Files (for me these are either App Data or Preferences files).

Last, you do not share the code used to Open these files.

You do not share the OS / Xojo versions.

These are important information that allow reader(s) to guess an answer.

IMHO.

No, the app can’t use this one. Must use Specialfolder.Applicationdata.child(“com.yourcompanyname.yourappname”)
instead.

Why ?

Emile,

I appreciate your comments but I am not using an open dialog for the preferences file by choice. For years I saved the preference file to the Preferences folder behind the scenes without any difficulty. It is only when I tried to change the Universal Type Identifier that this quit working and I changed to an open dialog to try to trouble shoot why it didn’t work. Open dialog using FileTypeGroup1.xxxx for the filter does work, but saving it to Preferences folder behind the scenes without using open dialog doesn’t. Likewise, saving it to Applicationdata doesn’t work. My issue started with changing the UTI and I’m trying to figure out how to fix this. I did what Xojo recommended in this thread (checking File type is unique, and changing the version number) but that didn’t fix the issue with the changed UTI. Using FileTypeGroup1.xxxx fixes it for open dialog but not for saving to any of the special folders. How do I make the FileType work with a new UTI?

I’m using Xojo 2020 R.2.1.
This code has worked for years but doesn’t now.
file = SpecialFolder.Preferences.Child(“ShisenPrefs.scpf”)

Why ?

To the ‘Why?’ above: Some years ago I’v read that we should move away from Specialfolder.Preferences to Specialfolder.Applicationdata

Seems it’s not recommended to use the .Preferences folder to save preferences.

Not entirely true.

I search in the docs…

http://documentation.xojo.com/api/files/specialfolder.html

Thank you. I discovers that because of your post.