The first one (org.the-meiers.coolterm-Settings) recently (not sure when because I didn’t pay attention) stopped working properly while the second one works just fine. What I mean by “not working properly” is that the Finder won’t show it’s icon, and when I use the Open dialog in my app, this file type is grayed out and can’t be selected.
I can’t figure out what the problem is. Any ideas? Any insight will be appreciated.
The extension .stc may be in conflict with other apps extensions - in a quick search i found that OpenOffice uses .stc als extension for its “Calc Spreadsheet Template Format”…
Hmm, interesting. The fact that changing .stc to something else makes it work seems to to indicate there is indeed something about this extension that may be the problem.
I’ve been using this extension for about 20 years, and haven’t come across any conflicts until now. I also don’t have OpenOffice on any of my machines. No idea what it may be colliding with.
If I remember correctly, Apple used to require registration of file extensions to prevent double use. Whether that’s still the case today: I have no idea.
But maybe this is a point you can start your search…
Hey hi, please verify that the icon file specified in UTTypeIconFileConnection.icns exist and is accessible and check that the file extensions specified in UTTypeTagSpecification match the file type stc.
I’d say you took a risk by defining an extension of only 3 characters. The Windows world is already filled with those, which can easily be ported to MacOS.
I usually use words (or longer extensions) to be [almost] safe.
Yeah, I know. I introduced the ability to save sessions only a few years ago, and I’m using .CoolTermSession as the file extension. That works without a problem.
Just for giggles, I made a build with .CoolTermSettings instead of .stc as the extension for settings files, and that works totally fine. So everything seems to be pointing at .stc being the culprit. That’s a bummer, because I really don’t want to change the file extension after all this time.
Well, it looks like I could have save myself a lot of googling and wondering if I had taken a closer look at “Get Info” of one of my settings files:
I have never installed OpenOffice on either of my Macs, so this must be something that is baked into macOS somewhere. Even one of my older ones, running Big Sur, thinks this is a OpenOffice file now. And I know for a fact this wasn’t the case before. This was my development machine before I upgraded my hardware because my development machine couldn’t be upgraded to Monterey. One of the service upgrades for Big Sur must have updated a database on the machine.
That still shouldn’t prevent your app from creating and opening these files, but I am going to make a suggestion…
UTI is a hierarchy system even though it’s not really exposed that way in Xojo. In your case the types have two levels:
org.the-meyers.coolterm-session
public.text
What you’re telling the system here is that your file type can also be opened by any app that can also open plain text.
This information is saved with the files when they are written by your app and is why you can have two apps with the same extension on the same machine.
Ultimately You could get the OpenOffice type to open in your app by simply dragging one of those files into the FileTypes editor. The IDE will ask the OS for all of the pieces and then you can just set the role to editor.
Hint: if you want to see all of the metadata associated with something on disk, just go to a terminal and type