Changing color labels of enclosed items

Discussion in 'Mac Basics and Help' started by ^Tripper^, Mar 7, 2013.

  1. ^Tripper^ macrumors member

    Joined:
    Oct 31, 2010
    Location:
    Disneyland with the Death Penalty
    #1
    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.
     
  2. xShane macrumors 6502a

    xShane

    Joined:
    Nov 2, 2012
    Location:
    United States
    #2
    Just select all (command-a) files and then right-click and you can apply a color change to all.
     
  3. ^Tripper^ thread starter macrumors member

    Joined:
    Oct 31, 2010
    Location:
    Disneyland with the Death Penalty
    #3
    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!
     
  4. ^Tripper^ thread starter macrumors member

    Joined:
    Oct 31, 2010
    Location:
    Disneyland with the Death Penalty
    #4
    Anyone?

    I'm offering a chilled beer to anybody who could help me resolve this!! :D
     
  5. kryten2, Mar 11, 2013
    Last edited: Mar 11, 2013

    kryten2 macrumors 6502a

    Joined:
    Mar 17, 2012
    Location:
    Belgium
    #5
    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.
     

    Attached Files:

  6. ^Tripper^ thread starter macrumors member

    Joined:
    Oct 31, 2010
    Location:
    Disneyland with the Death Penalty
    #6
    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
     
  7. kryten2 macrumors 6502a

    Joined:
    Mar 17, 2012
    Location:
    Belgium
  8. Gregg2 macrumors 603

    Joined:
    May 22, 2008
    Location:
    Milwaukee, WI
    #8
    Cleverly disguised for just such occasions. ;)
     

Share This Page