Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

^Tripper^

macrumors member
Original poster
My apologies if this has been asked before, a search yielded no results.

I'd like to change the color labels of folders and files. Ordinarily, this would mean 'command-I' and changing the labels. That works fine for individual files/folders but what I'm trying to do is to change the color labels of all files and folders enclosed within a main folder.

I've tried 'option-command-I' with no results. I've tried the gearbox 'apply to enclosed items' but this changes the permissions (which i do not want to change') and does nothing for the color labels.

I'm stumped.

Any help would be greatly appreciated.

PS, I'm doing this on Snow Leopard but I tried it on ML and had the same results, ie, I cant change the enclosed items color labels.
 
My apologies if this has been asked before, a search yielded no results.

I'd like to change the color labels of folders and files. Ordinarily, this would mean 'command-I' and changing the labels. That works fine for individual files/folders but what I'm trying to do is to change the color labels of all files and folders enclosed within a main folder.

I've tried 'option-command-I' with no results. I've tried the gearbox 'apply to enclosed items' but this changes the permissions (which i do not want to change') and does nothing for the color labels.

I'm stumped.

Any help would be greatly appreciated.

PS, I'm doing this on Snow Leopard but I tried it on ML and had the same results, ie, I cant change the enclosed items color labels.

Just select all (command-a) files and then right-click and you can apply a color change to all.
 
Thanks for the reply xShane.

Unfortunately, that does not do what I'm hoping to. You suggestion would work with the files selected, what I'm trying to do is to affect the files and folders within another folder.

For example I have "HD/soundsamples/drums/kits/dw/kicks/closemics/*"

I'd like to be able to select folder "drums" and change all files and folders within it to a certain color, including all files and folders after "drums".

Right now, all i can do is to go all the way down to "closemics" and change all the files within the folder. Which would be fine, but i have thousands of folders and its becoming a real PITA to do it this way...

Perhaps there isn't a way to do what i need to do, then i got no choice and do it at each folder 'step'. Just thought there may have been a way to just select the top most folder "soundsamples" and change all the colors within and following folders.

Appreciate your reply thou! Thank you!
 
Perhaps not what you wanted but you can give it a try. Copy and paste in Script Editor (Applescript) and let it run.

Code:
(*
Color Label Index 
" 0  No color"
" 1  Orange"
" 2  Red"
" 3  Yellow"
" 4  Blue"
" 5  Purple"
" 6  Green"
" 7  Gray"
*)
tell application "Finder"
	set sourceFolder to (choose folder with prompt "Select the start folder")
	my changeColorLabels(sourceFolder)
end tell

on changeColorLabels(thisFolder)
	tell application "Finder"
		set filesToChange to every file of thisFolder
		repeat with aFIle in filesToChange
			-- Change color labels of files
			set label index of aFIle to 2
		end repeat
		set subFolders to (every folder of thisFolder)
		repeat with aFolder in subFolders
			-- Change color labels of folders
			set label index of aFolder to 2
			my changeColorLabels(aFolder)
		end repeat
	end tell
end changeColorLabels

Looping through files and folders is slow in Applescript. You can also try Automator which is faster and the result is the same.
 

Attachments

  • Picture 16.png
    Picture 16.png
    242.3 KB · Views: 93
  • Picture 17.png
    Picture 17.png
    304.4 KB · Views: 104
  • Picture 20.png
    Picture 20.png
    150.8 KB · Views: 113
Last edited:
Kryten 2, THANK YOU!!!!!! You've saved me hours of work!!


Like wow. You even took the trouble to create sample folders and attached screen shots. Automator worked like a charm, everything is now exactly how I wanted it to be.

You, my friend, are a real life saver!


Thank you so much for the help!! That offer for a chilled beer stands! Heck, if you are ever in my part of the world, I'll buy you a hearty dinner before we head out for those beers! :D:D
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.