• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Removing Applications from the Dock Programmatically
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Removing Applications from the Dock Programmatically


  • Subject: Re: Removing Applications from the Dock Programmatically
  • From: Graff <email@hidden>
  • Date: Tue, 26 Aug 2008 20:50:17 -0400

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 (email@hidden)

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:
This email sent to email@hidden


References: 
 >Removing Applications from the Dock Programmatically (From: Kevin Kicklighter <email@hidden>)

  • Prev by Date: NSComboBox clicks make containing window disappear
  • Next by Date: Re: Removing Applications from the Dock Programmatically
  • Previous by thread: Re: Removing Applications from the Dock Programmatically
  • Next by thread: Re: Removing Applications from the Dock Programmatically
  • Index(es):
    • Date
    • Thread