n00b q: recursively change folder labels

ok, so i’ve never done anything with applescript before. But I’ve got a couple of things that I’d like to do, and I figure applescript is going to be the best way to do it.

1 - i’d like to create a script that when run, will recursively change all folder labels to a certain label color (index), starting from a predefined path level. (for example, run the script in my home directory and it will label all folders UNDER my home directory, the color yellow)

here’s what I’ve got so far:

tell application "Finder" to tell item "Macintosh HD" to tell item "Users" to tell item "[homedir]" to ¬
	set its label index to 3

I know, it’s basic, and not very dynamic, which is part of my problem.
So please, any help is HUGELY appreciated!!!

2 - I’d like to create a script that when run (or will constantly run in the background…?) will label all folders whose size is larger than 500mb with a black label.
no idea where to start here…

thanks so much. i hope these aren’t the most difficult things to get started with applescript on - but they were the first good idea I had for using it.


Here’s a script that will recursively set the label of the chosen folder and all subfolders:

To conditionally set the label if the size is greater than 500MB, get the size (in bytes) from the “get info” record and then parse it so that you’re working in MB to see if it meets the condition then set the label accordingly (no need to go to subfolders if it does not meet the size requirement because inherently, subfolders wouldn’t either):


[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]

wow - that’s a decent reply!

thanks! I was just expecting a nudge in the right direction, but that’ll work. I’ll have to take a look at all of it and see what I was doing and what was actually done to make it work.

thanks again - and for the quick reply!