For an application I'm developing, we developed a file format based on HTML, so that even users who don't have our app can preview the document using a web-browser.
However, for users who do have the app, we want to use it to open these files. We settled on using the '.shtml' extension, which is opened by the browser by default on most OSs, and not used widely.
We are now running into trouble to make MacOS understand that our .shtml files are different than regular .html files, and should be opened with our app. The problem is that MacOS already registers .shtml files as "public.html". Even if I define an UTI with UTTypeIdentifier "com.example.shtml", and UTTypeTagSpecification's public.filename-extension of 'shtml', the system always detects .shtml files as 'public.html' and not 'com.example.shtml', even though I set UTTypeConformsTo to 'public.html'...
The documentation about the heuristics the OS uses to detect system-defined UTIs is scarce, to say the least, so I cannot find how to change my file to not be detected as public.html. Any help, or pointers in the right direction is welcome. Thanks!
the file associations works based on mime type, UTI definations. hope these links help you https://developer.apple.com/library/content/documentation/FileManagement/Conceptual/understanding_utis/understand_utis_conc/understand_utis_conc.html https://developer.apple.com/library/content/documentation/FileManagement/Conceptual/understanding_utis/understand_utis_declare/understand_utis_declare.html
Unfortunately this is impossible since macOS added the SIP which prevents any modifications of system defined UTI without rebooting with SIP deactivated. What I suggest would be to set your app as default for public.html and redirect any file which doesn't match your requirements to the default browser for example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With