On Aug 26, 2008, at 5:34 PM, Kevin Kicklighter wrote:

I need to remove applications that were on the the Dock, programmatically (running Leopard 10.5.4). Does anyone have a clue as to how I could accomplish this?

You can access that information through NSUserDefaults as follows:

        NSUserDefaults *theDefaults = [NSUserDefaults standardUserDefaults];
NSDictionary *dockDict = [theDefaults persistentDomainForName:@"com.apple.dock"];
        NSArray *apps = [dockDict valueForKey:@"persistent-apps"];
        
        for(NSDictionary *anApp in apps)
        {
                NSLog([[anApp valueForKey:@"tile-data"] 
valueForKey:@"file-label"]);
        }

Tread carefully here because you could easily hose the Dock preferences while doing this.

Here's some more reading on the subject of user defaults:
<http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html >
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to