Skip to content

Instantly share code, notes, and snippets.

@Zettt
Last active December 3, 2024 11:01
Show Gist options
  • Save Zettt/5143159 to your computer and use it in GitHub Desktop.
Save Zettt/5143159 to your computer and use it in GitHub Desktop.
Set Color Label for selected Finder items
(*
No color = 0
Orange = 1
Red = 2
Yellow = 3
Blue = 4
Purple = 5
Green = 6
Gray = 7
*)
set mycolor to 7
tell application "Finder"
try
repeat with currentFile in items of (get selection)
if label index of currentFile is not mycolor then
set label index of currentFile to mycolor
else
set label index of currentFile to 0
end if
end repeat
on error e
return e
end try
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment