Batch file size tagging

I made an Applescript at work awhile back that would go through a folder of files and tag them with red dots if their file name exceeded 27 characters as I had to keep them no larger than 31 characters (including the dot 3 extension) at the time.

Because it could parse through all the files, I could do all kinds of things to the 3 file types (Photoshop, Illustrator and Canvas 9) that I used at work. I basically dbased each one of the various files in a Filemaker Pro dbase, got each file printed, and then copied each to a temp folder on a mounted Windows share.

----this script checks all the files in the STOCK FOLDER and if there are no problems, they all get filed, dbased and printed.
–label index numbers; 1 = orange, 2 = red, 3 = yellow, 4 = blue, 5 = purple, 6 = green, 7 = gray

tell application "Finder"
	activate
	set all_files to every file of folder "STOCK FOLDER" of folder "Desktop" of folder "<your username>" of folder "Users" of startup disk
	--returns list of files in the STOCK folder
	repeat with source_file in all_files
		set file_name to name of source_file
		set count_char to count characters of file_name
		if count_char is greater than "27" then
			set label index of source_file to 2
		end if
	end repeat
	delay 1
	beep 2
end tell