ServiceStation icon indicating copy to clipboard operation
ServiceStation copied to clipboard

RTFD recognised as Folder

Open gilby101 opened this issue 4 years ago • 5 comments

RTFD documents (and perhaps some other composite documents) are included in the ServiceStation definition of a Folder. So ServiceStation offers to open an RTFD document with Terminal. This can be fixed by changing the definition of Folder to be "Uniform Type Identifier is public.folder".

gilby101 avatar May 12 '20 11:05 gilby101

The Kind is Folder check is using the UTI public.directory aka kUTTypeDirectory.

The Kind → Directory row has more specific options, which you can use instead of writing your own UTI query:

Localized CFStringRef UTI
Any Directory kUTTypeDirectory public.directory
Folder kUTTypeFolder public.folder
Volume kUTTypeVolume public.volume
Package kUTTypePackage com.apple.package
Bundle kUTTypeBundle com.apple.bundle
Application Bundle kUTTypeApplicationBundle com.apple.application-bundle
Plugin Bundle kUTTypePluginBundle com.apple.plugin
Framework kUTTypeFramework com.apple.framework

pkamb avatar May 12 '20 22:05 pkamb

I'd have expected Kind is Folder to be false if the file is also a package.

Wevah avatar May 14 '20 05:05 Wevah

That is what I would have expected. Both Folders and RTFD have UTI public.directory (i.e. any directory). Folders also have public.folder. Service Station now has (has always had?) Kind → Directory with some nice subtypes corresponding to the UTIs in the table above. I am not sure if an upgrade to 2020.5 fixes that automatically, but I have now changed my definition of 'Folder' rule to be Kind → Directory with subtype Folder. All good, though it pays to understand UTIs to debug issues - use Terminal with the mdls command.

gilby101 avatar May 14 '20 06:05 gilby101

I think what happened is that for Kind is ... I chose the top-level UTI for "directory", which is kUTTypeDirectory / public.directory.

But then in the UI I changed that to the more user-friendly localized "Folder".

For the Kind → Directory row I didn't make that localization change, so Folder there refers to kUTTypeFolder / public.folder.

I should perhaps change that "Folder" localization back to "Directory". Or, change the UTI in the Kind is Folder selector to instead use public.folder.

pkamb avatar May 14 '20 20:05 pkamb

My view:

The simple Kind is Folder should refer to what everyone thinks of as a folder in Finder, that is UTI public.folder. Then there is no confusion with packages.

At the same time, I very much like the Kind → Directory (and the other Kind →) with their subtypes allowing the user to choose precisely without having to know about UTIs. It doesn't matter if the Kind → Directory → Folder is the same as the simple Kind is Folder.

gilby101 avatar May 15 '20 02:05 gilby101