Why doesn’t the Open File dialog show tagged folders?

Thanks to Carlos for a simple question: he uses tags a lot to distinguish folders and files for different projects. When using a tag view in the Open File and Save File dialogs, their behaviour is different. When saving a file, tagged folders are shown in the dialog, but in many apps they aren’t when trying to open a file. Could this be a bug?

My answer is that I think that this is correct behaviour, and stems from the different semantics of the two dialogs. They’re asking quite different questions.

semanticsopenfile01

When you’re saving a file for the first time, macOS wants two pieces of information: the name of the file into which it will write that document, and its location. It asks for those in two separate parts of the Save File dialog, with the name in a text box at the top, and most of the rest of the dialog devoted to a navigational function.

When you select one of the tag options in the sidebar, macOS needs to show you folders with the selected tag, so that you can select one of those in which you might save the document. It also lists existing documents with the same tag, as you might wish to overwrite one of them, base your new document’s file name on one, or save it alongside.

semanticsopenfile02

When you want to open a document, macOS only needs one piece of information: the document that you want to open. It will then work out its path and other information from that. So the Open File dialog is purely navigational.

When you select one of the tag options in the sidebar, macOS shows you not locations but documents with the selected tag, for you to choose from. It filters those documents according to the types which that app can open too.

semanticsopenfile03

Use the Open File dialog from an app which can open folders as documents – I take xattred here as an example – and tagged folders are included in the list of items which it can open. Because they are still folders, if you really want to you can use them to navigate to their contents, but that is a side-effect of the semantics.

One way of seeing this a bit more clearly is to look at the dialog as a dialogue between macOS and the user. In the Save File dialog, it starts something like
macOS: tell me the name and location of file
user: show me folders and documents I've tagged in purple, to help me choose both
but in Open File runs more like
macOS: tell me which document you want to open
user: show me all suitable documents which I've tagged in purple.

Carlos also noticed that some apps do offer tagged folders in their Open File dialogs. There are two explanations for this:

  • Like xattred, the app may be able to open folders as documents, either directly or as a way of generating contents for an in-app document browser.
  • Standard behaviour comes when apps use AppKit, as most Apple apps do. Those that don’t may create their own versions of these dialogs, which could behave quite differently.

Because of this behaviour, if you use tags to distinguish your different projects, you should not only apply them to the project folders, but to the files within them, so that you can select those tags in the sidebar when using both the Open File and Save File dialogs. Oddly, the Finder doesn’t provide a built-in Quick Action to tag all enclosed items within a Folder, which would have been very helpful. I’m just now looking to see if I can fill that gap, perhaps.