It's been well covered how to create a keyboard shortcut for the Tags… menu option in Finder. What I want is a way to tag selected files or folders with a single keyboard shortcut. The same shortcut should untag them.
Tag selected files in Finder with single keyboard shortcut
finder-tagshortcut
Related Question
- MacOS – In Yosemite, can you “un tag” more than 10 files at once
- Set tag color of image in Preview with hotkey/keyboard shortcut
- How to use a Keyboard Shortcut to tag files
- MacOS – Finder tag search exclusive
- MacOS – In Finder, first tag vanishes while adding a second tag
- How to replace rather than add tags in MacOS
Best Answer
The solution is to use the OS X built-in Automator and the great tag command-line utility.
In Run Shell Script, select "Pass input:" as
arguments
and use the following code:replacing the value of
TAG
with the name of the tag you want to use andtag
with the location where tag is installed (the one above should be default for brew).The script simply checks for each file whether it is already tagged with the given tag, and removes or adds the tag to switch it. You can go fancier from here.