Here's another approach, though notably less elegant than @Alexander's method. This solution uses only one macro, and requires you to set up the Smart Folder first. So do that, with the following criteria:
Change 14 to whatever interval you'd like, but whatever's there, that's what the macro will show. That's because this macro doesn't know (or care) about last access dates at all, as it's just going to use the list from the Smart Folder itself.
Once you have the Smart Folder set up and saved, install and activate the macro.
Download Macro(s): _Recent Folders List.kmmacros (13 KB)
- Macros are always disabled when imported into the Keyboard Maestro Editor.
- The user must ensure the macro is enabled.
- The user must also ensure the macro's parent macro-group is enabled.
- macOS 13.x or 14.x
- Keyboard Maestro v10.x or 11.x
In the macro, there's one variable you must change, and one variable you might want to change. The variable you must change is the first green box, which holds the path to the saved Smart Folder. Enter the full path to that location.
The variable you might want to change is the second one, for the update check interval. This will require a bit of explanation...
The way this macro works is through three global variable, all stored with the prefix
rg_RFL_. Two of them simply track the current run time and the last run time. The third holds the list of recently-accessed folders, which it gets directly from Finder's Smart Folder.
NOTE: Whatever order the Smart Folder shows in Finder is the order that will show in the pop-up list. So if you want the list in most-recently-used order, set the Finder's view to sort by date accessed. If you want it in alphabetical order, sort by name.
However, as there's no way to access the contents of that folder without opening Finder and doing some GUI stuff in the foreground, the second green box controls how often that disruptive activity happens. (I had hoped you could see the contents in Terminal, so it could be silently updated, but no luck.)
If you want to always have a fresh list, set the time in minutes to 0.002 or some tiny number. Then you'll always get a fresh list, but you'll always see the disruptive Finder activity before the list appears. Set it to five minutes, and you'll only see that activity if it's been more than five minutes since you last ran the macro.
As noted, this is much less elegant than Alexander's solution. However, it's simpler in that it relies on Finder to keep track of the folders, and just accesses that list to let you navigate to the chosen folder.
You could take a similar tact and remove the disruptive Finder activity by using
find in Terminal with a list of locations to search, but that requires defining those locations in advance.
Two different approaches to solving one problem—and sometime soonish, I'll post a third, which isn't based on recents, but instead makes it easy to browse a selection of folders you define.