Skip to content

Instantly share code, notes, and snippets.

@apricot13
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apricot13/4b2b7871fb9355061cc4 to your computer and use it in GitHub Desktop.
Save apricot13/4b2b7871fb9355061cc4 to your computer and use it in GitHub Desktop.
Applescript: Watch folder and update labels
-- I want edited folders to be red.
	property red : 2
    on adding folder items to this_folder after receiving added_items
         try
              tell application "Finder"
          -- set label of the 'watched' folder to red
                   set label index of this_folder to red
                   -- for the items added
                   repeat with item_ in added_items
                        if kind of item_ is "Folder" then --if its a folder then make it red
                             set label index of item_ to red
                        else -- else make it red....!
                             set label index of item_ to red
                        end if
                   end repeat
              end tell
         on error
              display dialog "Error occured"
              return
         end try
    end adding folder items to
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment