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

bensonang

macrumors newbie
Original poster
Mar 12, 2010
2
0
The code below works perfectly in adding an icon to the dock.

Code:
NSAppleScript* placeInDock = [[[NSAppleScript alloc] initWithSource:[NSString stringWithFormat:@"do shell script \"	defaults write com.apple.dock persistent-others -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/myFolder/</string><key>_CFURLStringType</key><integer>0</integer></dict></dict><key>tile-type</key><string>directory-tile</string></dict>'\""]] autorelease];

My problem is that when I add the Dock icon, it is a folder and I want it to show as a FOLDER icon, not the stacks.

How do I do this? I tried to add
<key>displayas</key><integer>1</integer>
after <key>tile-data</key> but it does not work. Instead, the code won't work anymore.

Any help would be appreciated.
 
The easiest way to do this from the command line would be to use dockutil. For full disclosure I have contributed some code to that project.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.