Last active
August 29, 2015 14:24
-
-
Save avwave/670918dc7b9622745433 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set theSearchPath to "/Users/<username>" | |
set theResults to do shell script "find " & quoted form of theSearchPath & " -name .git 2>&1 | grep -v 'Permission denied'" | |
repeat with i from 1 to (count paragraphs of theResults) | |
set theResult to paragraph i of theResults | |
set theParentPath to text 1 through ((length of theResult) - 5) of theResult | |
set theParentAlias to POSIX file (theParentPath) as alias | |
tell application "Finder" | |
set label index of theParentAlias to 6 | |
-- Set the last value of the previous line corresponding to label color desired | |
-- 0 (no color) | |
-- 1 (orange) | |
-- 2 (red) | |
-- 3 (yellow) | |
-- 4 (blue) | |
-- 5 (purple) | |
-- 6 (green) | |
-- 7 (gray) | |
end tell | |
end repeat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment