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

ngoh

macrumors newbie
Original poster
Nov 3, 2008
6
0
Hello, I'm trying to come up with a script that will automatically label green (or whatever color) new added files on X folder. I have the new item alert script enabled on the folder, but would like to add the feature of automatic labeling.

Thanks for your help.
 

hiddenpremise

macrumors regular
According to Finder's dictionary in Script Editor running on a 10.5.6 system, the featuring controlling label's is not available.
Script_Editor said:
label n : (NOT AVAILABLE YET) A Finder label (name and color)
properties
name (text) : the name associated with the label
index (integer) : the index in the front-to-back ordering within its container
color (RGB color) : the color associated with the label
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
If you have Xcode you can download the osxutils package, and compile the setlabel tool which lets you set the label on a file. Combine that with AppleScript's do shell script command and you're set. If you don't have Xcode let me know and I can upload a compiled version of the program.
 

ngoh

macrumors newbie
Original poster
Nov 3, 2008
6
0
If you have Xcode you can download the osxutils package, and compile the setlabel tool which lets you set the label on a file. Combine that with AppleScript's do shell script command and you're set. If you don't have Xcode let me know and I can upload a compiled version of the program.

I don't have Xcode yet. I'd appreciate if you could upload the compiled version of the program.

Thanks for the help, hiddenpremise and kainjow.
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
Here you go. The binary is in build/Deployment. To see how to use it in Terminal type "man setlabel.1" where setlabel.1 is the full path of that file.
 

Attachments

  • setlabel.zip
    14.9 KB · Views: 56
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.