Created
May 25, 2018 14:26
-
-
Save NaanProphet/b56866bddd65d7c7be20740496ffb66b to your computer and use it in GitHub Desktop.
Determine Finder Label Color from Terminal
This file contains 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
# 0 = no colour | |
# 1 = orange | |
# 2 = red | |
# 3 = yellow | |
# 4 = blue | |
# 5 = purple | |
# 6 = green | |
# 7 = grey | |
getlabel() { | |
osascript - "$@" << EOF | |
on run argv | |
tell application "Finder" | |
set theArg to POSIX file (argv) as alias | |
set labelIndex to (get label index of theArg) | |
do shell script("echo " & labelIndex) | |
end tell | |
end run | |
EOF | |
} | |
# special thanks to: | |
# https://stackoverflow.com/questions/1464641/how-to-see-what-label-color-is-on-a-file-folder-from-within-termnal-mac-os-x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment