Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.7: Set Finder Labels from the keyboard System 10.7
At one time you could hack the Finder to assign keyboard shortcuts to assign labels to selected files and folders. Then that useful functionality was lost in the course of Mac OS X Finder development. Hope glimmered briefly with hints such as this:

Create a keyboard-shortcut for Show Package Contents
and:
10.5: Add a Show Package Contents keyboard shortcut

But inspiration struck with this hint about adding the Labels button to the Finder toolbar:
10.7: Set Label toolbar icon to your choice of colors

So here's how you too can be keystrokes away from color-coding your Finder's files and folders as much as you wish:
  • Add the Label button to the Finder toolbar. Not sure how? In the Finder select View » Customize Toolbar... and drag the Labels button to a desirable location on your toolbar.
  • Open up the Keyboard System Preference pane and select the Keyboard Shortcuts tab.
  • Highlight Application Shortcuts and click the + button.
  • Select Finder from the Application: drop down menu
  • For menu title enter the text color name of the label you want to assign a keyboard shortcut for. For example, Red.
  • Enter your desired keyboard shortcut. I opted for Control+Shift+(1 through 7) and Control+Shift+~ for no labels.
Note that the behavior seems a little inconsistent. First and foremost, you have to use the Label button once in a window before the keyboard shortcut you assign becomes available. It also doesn't work on the Desktop proper because there is no Label button available. Likewise, it doesn't work when the toolbar is hidden.

If you can accept those caveats, and used to frequently use labels to classify files and folders, then this will give you a good shortcut for doing so.

[crarko adds: I tested this, and it works as described. Pay attention to the caveats, though. Also note that it changes the default color of the Label button in the Finder Toolbar to whichever color you applied most recently.]
    •    
  • Currently 3.50 / 5
  You rated: 3 / 5 (4 votes cast)
 
[28,190 views]  

10.7: Set Finder Labels from the keyboard | 2 comments | Create New Account
Click here to return to the '10.7: Set Finder Labels from the keyboard' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.7: Set Finder Labels from the keyboard
Authored by: gregpare on Sep 19, '11 09:09:03AM

Over the years I've used an applescript for this and setup up a hotkey using programs like butler and spark. Don't know where I got it at this point, but here it is. Changing the line "set label index of item_ to 6" to a different number will yield different results. In this case it's green. Zero turns off labels for those items.

tell application "Finder"
set items_ to selection
repeat with item_ in items_
try
set label index of item_ to 6
on error e
display dialog e
end try
end repeat
end tell



[ Reply to This | # ]
10.7: Set Finder Labels from the keyboard
Authored by: Lri on Sep 19, '11 03:52:25PM

I've assigned scripts like this shortcuts in FastScripts:

try
	tell application "Finder"
		repeat with f in items of (get selection)
			set label index of f to item 1 of {2, 1, 3, 6, 4, 5, 7}
		end repeat
	end tell
end try

They can be pretty slow though, something like a few seconds for hundreds of files.



[ Reply to This | # ]