How To Set a Folder Icon?

OK easy to do a file, but I'm not sure how to make a macro to set a folder's icon?

Hey there! There are different ways of doing it, and it would depend on what you’re trying to accomplish.

For example, do you wish to set the icon of the folder that is currently open?
Or do you wish to set the icon of the folder that you have selected in Finder?
Or some other method?

That being said, here's a very simply macro that will set the icon of the folder that is currently open and at the front. Obviously you can change the icon itself in the Set file action at the bottom of the macro. If this works for you, great! If not, or you need to do it some other way, provide us more details as to your overall workflow and we can no doubt point you in the right direction.

EDIT: The macro now contains two ways of doing it. Either with the currently open folder, or the currently selected folder in Finder. Just enable/disable whichever ones you want to use. The underlying principles can be used in other macros to accomplish the same thing.

06)Set currently open folder's icon.kmmacros (15 KB)

Macro screenshot (click to expand/collapse)

1 Like

that's brilliant Chris! specifically i want some macros to set the folder icon for specific pre-existing folders...im assuming i can do that by plugging in the variable?

Technically you don't need to use a variable if you already know the folder's path. You simply put the path right into the set file action.

In the example macros variables are used to temporarily save the path of whatever folder you are interacting with that way KM knows where to apply the icon.

See this example (same folder, just two different ways of supplying the path):

1 Like

Ah, thanks again, one annoying thing is afaik its not possible to browse to a folder using 'set file'...i had to drag the folder then copy/paste the path into the Set file action...

You're welcome! And if you click the purple folder icon you can indeed browse to and select the folder/file you want. If you hold ⌥ while clicking the folder icon, it will open that location in Finder (assuming there's a path in the text field).

Hi—here are a couple of macros that I use for changing file/folder icons.

I often keep the link to a Bear note in project folders. They are plug ugly so I like to replace with a prettier (& more helpful) Bear icon. I keep this icon, along with the rest, in a folder.

  1. "Icon grabber · Bear" macro copies the icon to my pasteboard. (You'll need to change the path. Or you could just have it open your icon folder)
  2. Then I select the Bear‑link file, just in Finder.
  3. Finally, I run "Icon changer" macro, which replaces the old icon of the Bear link with the Bear icon.

You could just run "Icon grabber · Bear" on its own if you want to manually copy images to the pasteboard.

Global Macro Group Macros.kmmacros (10.4 KB)