Open Folder Files Were Last Added To

Is there a way to open the last folder to which a file was added and then sort that folder by "Date Added"?

Often, I save files from my email program (Postbox) to folders and then immediately need to open the files from those folders.

Thank you.

1 Like

Hey there, I'm not aware of any way for KM to mass-monitor folders like that, but the second part is real easy.

For instance, below is a macro I use to automatically change my Finder layout anytime I switch folders (because I got tired of macOS not correctly saving my preferences). It changes the layout to list, and sorts by kind.

20)[AS-F] Auto configure Finder windows.kmmacros (9.2 KB)

Macro screenshot (click to expand/collapse)

For what you want to do, you could do the following:

Set sort by date added.kmmacros (2.9 KB)

Macro screenshot (click to expand/collapse)

Going back to your initial question about opening the folder where a file was last added, it might be possible through Spotlight or Alfred integration, but that's beyond me.

Try searching the forum however for Spotlight search or Alfred search and you might find something useful.

Likely others more knowledgeable than I will chime in shortly too.



Great finder macros added above - i mistakingly once upon a time did not have a cancel macro action and almost threw my computer out the window :rofl:

For the Folder organization, auto creating sub-folders, and anything to do with file management β€” Hazel (mac app), it’s extremely powerful but very simple to use.

1 Like

Haha man I know that feeling... :laughing:

Good point about Hazel, I use it too although not nearly as much as I probably should.

Hmm... I have and use Default Folder X (via Setapp subscription). Wonder if there's a simple way to use it to do this. Maybe KM isn't what I need here?

Could you have a macro that does the saving to a folder for you? That way the macro would know exactly which file it is already and could just open it.

Hi @RochelleBroder,

I have a similar requirement: When an item is added to the downloads folder:

  • The Finder should open to ~/Downloads.
  • The Finder window should be relatively small and positioned in the upper-left quadrant of my display.
  • Since I use multiple Desktop Spaces, the Finder window must open in the space I'm using, not trigger an unintended switch to another space.
  • The new item in ~/Downloads should be selected and the color label changed to blue.

(BTW, I have a similar requirement for my screenshots folder.)

First I'll show you how I do it, and then I'll mention some other possibilities.

Hazel is another great automation tool. Monitoring folders and taking actions based of folder changes is its specialty. In this case, I use it to monitor ~/Downloads. When an item is added to that folder, Hazel:

  • Sets the color label to blue.
  • Runs an AppleScript that launches a KM macro: Open Downloads in Active Space.
  • Selects the added item in the Finder window.

Here's the the KM macro that it launches:

DOWNLOAD Macro File:
Open Downloads In Active Space.kmmacros (6.7 KB)
Note: This macro was uploaded in a DISABLED state. It must be ENABLED before it can be run. If it does not trigger, the macro group might also need to be ENABLED.


In the macro that I downloaded, you'll see this Trigger:

Since I'm using Hazel, I don't normally have that Trigger set. But if you don't have Hazel, I'd give it a try. Unfortunately I don't remember the details, but I think I had some reliability problems with it when ~/Downloads was already open in another Desktop Space. Whereas I've never had an issues with the Hazel/KM combination.

Another possible approach would be to replace Hazel with a macOS Folder Action. Creating one of these to launch a KM macro wouldn't be too difficult, by Hazel is certainly easier.

To organize my workspace, I paint folders in different colors using One customer = one color