Set Finder-Labels via Butler

I’m one of those “keep my hand on the keyboard at all times” sort of guys. So I was annoyed recently when I discovered that there was no keyboard shortcut to set an item’s color label in the Finder. While I don’t always use the Finder’s color labels, I often find them invaluable when working on projects with complex file and folder structures, indicating which files are “done” and which files are “pending.” Using Butler’s outstanding ability to execute any AppleScript code via a key combination, I set up the following script:

tell application “Finder”
set thisItem to selection as alias
if label index of thisItem = 0 then
set the label index of thisItem to 2 — 2 = red
set label index of thisItem to 0 — 0 = no label
end if
end tell

I then set it to run with the arbitrary key-combination of Option-Command-Control-L. This code will toggle on and off the Red label only. However, using Butler and modifying the AppleScript, one could set a combo to toggle all the different labels on and off — perhaps using one to six on your keyboard, with appropriate modifier keys.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s