Dorico projects not in MacOS Finder "Recents" window

I find the MacOS (Big Sur) “Recents” Finder window very useful but .musicxml files and .dorico files don’t appear in it whereas, frustratingly, .sib files do!

OK, I know I can use a smart folder to achieve almost the same thing as “Recents” but … presumably Sibelius does something that registers .sib files so that they are recognised in “Recents”. Can Dorico not do the same?
I can find no way in the MacOS GUI of customising Finder to extend the types of file it recognises.

Spotlight is a bit fussy about what it considers to be a “Document”, which is a subset of ‘Files’.

(Notice that you can choose search terms for files as either “Text, Images, Video, PDF, Document, or Other”.)

I notice that Affinity Suite documents aren’t included either. Nor are Finale .musx files. (Though MusicXML files are.)

There isn’t a user configuration for what counts as a document. I’m not sure if the devs can flag the file type as such.

After a bit of research, it seems that Spotlight only considers a file a ‘document’ if there is a Spotlight ‘importer’ for it – which is a plug-in to provide Spotlight with things like metadata or file contents for the file type.

Sibelius, it seems, does have a Spotlight importer. Finale used to, but it was removed because it kept crashing Spotlight and ramping up the CPU.

It was a nice feature, as you could search for all files in D major with a Violin part, modified last month.

I believe it’s on Dorico’s To Do list, but as a Mac-only feature, presumably not high-priority.

We definitely do plan to add both a Spotlight importer and a Quick Look generator, but they’re sufficiently tricky to do that we’ve not managed to prioritise it yet.

By way of example for how tricky they are to create: Apple (rightly) requires that your Quick Look generator can generate a preview for any file in less than five seconds (this being their threshold for what counts as “quick”, I suppose). If your Quick Look generator takes longer than five seconds to return, it gets killed by macOS. This is why the Sibelius Quick Look importer works for some smaller, trivial files, but not for larger ones: if it takes longer than five seconds to load and render the score, it will get killed by the OS.

Thanks Daniel. Even the Spotlight importer without the Quicklook generator would be useful - personally I think I would use the former quite a bit and the latter hardly at all.
I was looking on GitHub at several (not very recent) examples and also an account of somebody’s more recent exploration. Next lockdown I might have a crack at it :wink:

Specifically, I suppose it would be the ability to

  1. Search with Spotlight on metadata from a Dorico file’s Project Info and

  2. “Recents” to include Dorico Projects (but not necessarily loads of timestamped auto backed up files)

Unless you exclude the Backup folder from Spotlight, there’s no way to distinguish backup files and autosaves, as they are just .dorico files.

The updates in Dorico 4.0.20 has the very welcome inclusion of the Spotlight-searchable Dorico project metadata (and Quicklooks - thanks) so I was expecting Dorico files to appear in Recents but even though I’ve re-indexed Spotlight on the directory in which I keep lots of Dorico projects, Recents. doesn’t seem to display them as I was expecting (hoping).

I’m not sure whether Ben’s idea that documents only show up in the Recents folder when a Spotlight importer is present for a particular document format is correct, so I don’t know whether the introduction of a Spotlight importer is the necessary condition for that to start working.

Good point. The list below shows that Sibelius doesn’t have a Spotlight importer, yet its files show up in Recents.


√ ~ % mdimport -L
Paths: id(501) (
    "/System/Library/Spotlight/SystemPrefs.mdimporter",
    "/System/Library/Spotlight/Chat.mdimporter",
    "/System/Library/Spotlight/iWork.mdimporter",
    "/System/Library/Spotlight/iPhoto.mdimporter",
    "/System/Library/Spotlight/PDF.mdimporter",
    "/System/Library/Spotlight/RichText.mdimporter",
    "/System/Library/Spotlight/Office.mdimporter",
    "/System/Library/Spotlight/PS.mdimporter",
    "/System/Library/Spotlight/MIDI.mdimporter",
    "/System/Library/Spotlight/Archives.mdimporter",
    "/System/Library/Spotlight/Audio.mdimporter",
    "/System/Library/Spotlight/iPhoto8.mdimporter",
    "/System/Library/Spotlight/Automator.mdimporter",
    "/System/Library/Spotlight/Application.mdimporter",
    "/System/Library/Spotlight/Font.mdimporter",
    "/System/Library/Spotlight/Mail.mdimporter",
    "/System/Library/Spotlight/vCard.mdimporter",
    "/System/Library/Spotlight/Image.mdimporter",
    "/System/Library/Spotlight/iCal.mdimporter",
    "/System/Library/Spotlight/CoreMedia.mdimporter",
    "/Library/Spotlight/iBooksAuthor.mdimporter",
    "/Applications/LibreOffice.app/Contents/Library/Spotlight/OOoSpotlightImporter.mdimporter",
    "/Applications/TeX/TeXShop.app/Contents/Library/Spotlight/TeX.mdimporter",
    "/Applications/GarageBand.app/Contents/Library/Spotlight/GarageBandSpotlightImporter.mdimporter",
    "/Applications/GarageBand.app/Contents/Library/Spotlight/LogicX_MDImport.mdimporter",
    "/Applications/Dorico 4.app/Contents/Library/Spotlight/DoricoMDImporter.mdimporter",
    "/Applications/TeX/TeX Live Utility.app/Contents/Library/Spotlight/DVIImporter.mdimporter",
    "/Applications/TeX/BibDesk.app/Contents/Library/Spotlight/BibImporter.mdimporter",
    "/Applications/MindNode.app/Contents/Library/Spotlight/MindNodeSpotlightImporter.mdimporter",
    "/Applications/Xcode.app/Contents/Library/Spotlight/uuid.mdimporter"
)
√ ~ % 

I can’t remember how I came up with that hypothesis, but clearly there’s more to it!

Whatever the magic is, today Recents showed the Dorico file as soon as I opened it :slightly_smiling_face:.

Maybe it just takes longer than I anticipated, after installing the Dorico 4.0.20, for Spotlight to re-index the directories in which I store Dorico projects.

Anyway, I will find this very useful. Thanks!

Hmmm… not quite the end of the story :worried:

It would appear (and correct me) that the file will only appear in Recents >> Today if it was last opened today.

But look at the two files below, both of which were correctly last modified today as I made changes in Dorico and saved the files before quitting as usual.

But one of them (the one not showing in Recents) has a last opened date of last month :fearful:

BTW the Recents >> February doesn’t show the file with a February last opened date either …

I’ve had a look through both the built-in Help book accessed via the Finder’s Help menu, and on the Apple support web site, and I can’t find any definitive description of the criteria for how the Finder decides to show folders in the Recents smart folder. I guess you will need to take this up with Apple if you need further help in this area. I’m 99.9% sure there’s nothing we as the application developer can do to influence whether or not a file appears in Recents.

Well, could be that it’s the way that Dorico 4 is writing out the edited file to MacOS because if I import and edit a Dorico project in iPad Dorico and file it as a Dorico Project file back to my iCloud Documents folder, it is immediately picked up in Recents on the Mac as the last opened date is correctly updated whereas this is not the case with edits made in MacOS Dorico 4.

The project lives in a subfolder of iCloud >> Documents
As long I was editing it on the Mac in Dorico 4 the last opened time stamp remained in February.
As soon as I edited that same file on Dorico for iPad and saved (overwrote) the file back to that same subfolder of iCloud >> Documents it appeared in Recents.

According to Apple’s documentation, the “last opened” date is metadata that the operating system maintains for files on the system in the Launch Services database. The value is updated when you e.g. open a file by double-clicking it in the Finder, or when an application asks Launch Services to open a file. Opening a file from the Hub or using File > Open within Dorico does not use Launch Services. So if it’s very important to you that you see files you have opened recently in your Recents smart folder, I would suggest you try to open them by double-clicking them in the Finder.

That’s good to know.

Now I need to decide just how important my habit of using Recents is to me :thinking:

Thanks @dspreadbury for getting to the bottom of this.

Sadly, despite Apple’s documentation, double-clicking the finder icon does not update kMDItemLastUsedDate.
If I had a current developer subscription I would report this as a bug.

Are you sure? It works for me.