Jump to content

Finder Label Colour Hotkey


Recommended Posts

Hello,

I'm really new to Alfred and used to use Quicksilver. I had a script that would allow me to apply a colour label to files in finder, but cannot get it to work properly in Alfred. Does anyone have a solution they use?

Many thanks,

Will

 

Here is the script I use at the moment:

 

 

on alfred_script(q)
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
  else
    set label index of thisItem to 0 -- 0 = no label
  end if
end tell
end alfred_script
Link to comment
on alfred_script(q)

    activate application "SystemUIServer" -- http://www.openradar.me/9406282

    activate application "Finder"

    tell application "Finder"

        repeat with f in selection as alias list

            if label index of f is 0 then

                set label index of f to 2

            else

                set label index of f to 0

            end if

        end repeat

    end tell

end alfred_script

 

Finder has a bug in 10.7 and 10.8 where the selection property refers to the second frontmost window (or the desktop) after you open a new window. As a workaround, you can move focus to another application and back, but it results in a visual glitch.

 

You can reduce the delay for hotkeys by secondary-clicking a shortcut recorder and setting the trigger behavior to pass through modifier keys.
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...