Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > AppleScript HELP!: Labelling originally installed items.

AppleScript HELP!: Labelling originally installed items.
Thread Tools
Senior User
Join Date: Oct 1999
Location: Sin City™, USA
Status: Offline
Reply With Quote
Jul 31, 2005, 07:18 PM
 
Hey, Folks.
I need a bit of AppleScript help.

I just ordered a dual 2.7Ghz G5 and would like to be able to keep track of originally installed system software from the get go.

Back in the days of Mac OS 9 (remember that?) I used a cool little (albeit simplistic) AppleScript that would automatically assign the color Label of my choice to every item inside the System Folder. By doing this, whenever doing any troubleshooting, I could easily see what files were original and which one were added by other applications or utilities.

I've had some trouble finding a way to do this in Mac OS X. What I’d like to do is assign the gray, or seventh, label to all items enclosed in the root level Library folder, the root level System folder and possibly my user account's Library folder.

The script used under OS 9 was this:

tell application "Finder"
activate
set label index of every item of the entire contents of folder "System Folder" of startup disk to 7
end tell

Will this work under Mac OS X if I just modify the proper target folder's name?

I really appreciate any help and input here.

TIA!

To dislike Sinatra is a sign of highly questionable taste. To dislike the Beatles is a serious character flaw.
     
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Aug 1, 2005, 03:22 AM
 
Hi,

You might have permissions problems changing the labels in the /System directory.

Also - just tried your script - and alas it needs to be a bit more verbose to work under OS X:

This modified test version worked for me - you can alter it to change the folders you want...

[php]
tell application "Finder"
-- activate

set pubDir to folder "Public" of home
-- get properties of pubDir

set pubContentsList to the entire contents of pubDir

repeat with itemIndex from 1 to number of items in pubContentsList
set this_item to item itemIndex of pubContentsList
set label index of this_item to 7
end repeat

end tell

[/php]
You know it makes sense. ☼ ☼ ☼ Growl.
     
crooner  (op)
Senior User
Join Date: Oct 1999
Location: Sin City™, USA
Status: Offline
Reply With Quote
Aug 16, 2005, 09:16 AM
 
Originally Posted by Diggory Laycock
Hi,

You might have permissions problems changing the labels in the /System directory.

Also - just tried your script - and alas it needs to be a bit more verbose to work under OS X:

This modified test version worked for me - you can alter it to change the folders you want...

[php]
tell application "Finder"
-- activate

set pubDir to folder "Public" of home
-- get properties of pubDir

set pubContentsList to the entire contents of pubDir

repeat with itemIndex from 1 to number of items in pubContentsList
set this_item to item itemIndex of pubContentsList
set label index of this_item to 7
end repeat

end tell

[/php]
DL,
I realized I never bothered to thank you for your help. It was much appreciated and worked.

True... there were some items that wouldn’t be labeled due to permissions, but all in all, the script did help me with being able to discern what files were virgin installed and what were copied over by Apple’s migration assistant.

To dislike Sinatra is a sign of highly questionable taste. To dislike the Beatles is a serious character flaw.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:23 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2