Using defaults to remove a dock icon...

I've been tinkering with this for a full day now and haven't really gotten out of the starting gate.
Does anybody have a working example for using 'defaults' to delete anything...
And yes I know defaults is run from a shell and this is technically not an AS related question, but it can be called from AS, so I'm asking.

Using defaults for arrays and records is pretty much a mess - is there a particular reason for not wanting to use the System Events *Property List Suite* or a scripting addition such as the Satimage XMLLib osax?
Note that the Dock preferences property list only keeps track of the applications and other items that you are keeping there (minus the FInder), and to update you will need to restart the Dock. Just dragging the item off the Dock sure seems simpler to me.

Similar Messages

  • Using 'defaults delete' command with com.apple.dock

    I have been using the "defaults" command in my scripts to add an icon to a user's dock after a new application has been installed. But now, I'm having trouble trying to figure out how to remove an icon from the dock using the command line. For adding an icon, I use:
    defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict>
    <key>_CFURLString</key><string>/Applications/NewApp/Program.app
    </string><key>_CFURLStringType</key><integer>0</integer>
    </dict></dict></dict>'
    (take out all the carriage returns and spaces. I had to put them in here for the line to show properly on the post)
    This works great for adding an icon. But, I cannot seem to write something similar using "defaults delete"
    Any help is appreciated.
    Thanks,
    -Steve
    PowerMac G5   Mac OS X (10.4.7)  

    Hi Steve,
       If it froze then the code isn't robust against problems. In this case the problem is the web. The command has four spaces in a row in two of the matches. However, the browser smashes that down into a single space. I never understood that aspect of HTML but I know about it and should have considered it. I will replace the spaces with capital Xs. If you replace the Xs with regular spaces, the command should work:
    defaults write com.apple.dock persistent-apps "$( defaults read com.apple.dock persistent-apps | awk 'BEGIN{ ARRAY = "("; ELEM = "" } /^XXXX{/{ while ( $0 !~ /^XXXX}/ ) { if ( ELEM == "" ){ ELEM = $0 } else { ELEM = ELEM "\n" $0 } if ( $0 ~ "_CFURLString\"" && $0 !~ /zzzz/ ){ FOUND = "true" } getline } ELEM = ELEM "\n" $0; if ( FOUND == "true" ){ ARRAY = ARRAY "\n" ELEM }; FOUND = "false"; ELEM = "" } END{ sub( /,[^\n]*$/, "", ARRAY); print ARRAY; print }' )"
    In some sense that is poor coding but in the default syntax of the "defaults" command, the only way to determine depth is by how far something is indented. It would have been far more robust to actually count the number of opening parentheses and keep track of the depth but that would have been more complex to code. If I have time, I'll look into changing that.
       I assume that the reason the command hung is that it went into an infinite loop. I've also added a carat, '^', in front of the first group of four spaces that will keep that from happening. When typed correctly the command works without it but now it will fail without going into an infinite loop.
    Gary
    ~~~~
       United Nations, New York, December 25. The peace and joy of the Christmas season was marred by a proclamation of a general strike of all the military forces of the world. Panic reigns in the hearts of all the patriots of every persuasion. Meanwhile, fears of universal disaster sank to an all-time low over the world.
          -- Isaac Asimov

  • Remove Dock Icon

    Is it possible to remove the Virtualbox icon from the Dock while it's running?
    Thanks for the help.

    Perhaps the question was too vague and that's why there has been no response. Or maybe nobody knows. Let me try to elaborate. 
    I run Virtualbox with a guest OS on my iMac. Unfortunately there is no way to easily remove the dock icon from the dock while the application is running. It's rather useless and a waist of space to have the icon in the dock with OSX 10.7 or 10.8. Mission Control and Command+Tab offer easy ways to switch to the desktop with the VM. So that being said I would very much like to remove the dock icon for this application but I can't seem to find any relevant information about this process on the Internet. 
    Does anyone know of a way to remove the dock icon of a running application from the dock? Perhaps a terminal command that will do the job or a different application. Any input will help. Thanks. 

  • Dock Icon Problem

    Okay I'm having trouble getting rid of some of the icons that are on my dock. I tried to just drag them into the trash bin but when I let go, it just goes right back to it's spot on the dock. It's quite frustrating. Can anyone help me out. Oh and this is only my second day with a Mac so please bear with me lol.

    There are multiple ways to remove a dock icon. Try right clicking on the icon and click "Remove From Dock." Does this work?

  • Safari dock icon reverted to generic app icon after 7.0.6 update

    Hi
    Since the 7.0.6 update, Safari has the generic Applications icon in the dock, not the Safari icon. This is also true of the software application in the Applications folder. I've tried restarting my Mac, and removing the dock icon and putting it back. I'll try deleting and re-downloading Safari from the App Store if no-one has any other ideas.
    I've had this problem with a 3rd party app (1password) and got very snippy with the AgileBits support lady about it, but now it's happened with an apple native app I'm guessing this is Mavericks?
    Any suggestions?
    Thanks.

    Fixed it. Repaired disk permissions then restarted.

  • Children at my Mac – non-removable dock icons

    The main reason I created a separate user account for my four-year old son was to allow him making a mess without annoying anybody. Which turned out to be a very wise decision. Even when he was a small baby he had the special gift of activating some obscure Mac OS X function I never knew existed – and of course I always had a hard time finding out how to deactivate it afterwards.
    So there he goes with his own account, happily dragging files around in Finder and making a mess of his very own desktop. Now, a while ago he proudly showed me what he did to his dock. I have to admit it was an amazing sight. He had dragged about two dozen files, most of them Objective-C header files, to the dock, squishing up all the programs in the far left corner. Well done, or so I said, until a week later I tried to clean up for him.
    I don't know what sort of sticky glue he must have used, but now I cannot pull those header files off again, I can't even rearrange them. Same for the program icons. When I bring up the context menu, it doesn't show the 'remove from dock' option. It looks like the dock is locked or something.
    So again, my son's discovered some feature I didn't even know existed. Can anybody tell me how to unlock the dock again?
    cheers
    Hendrik
    P.S. I'd love to share the screenshot, but I don't think Apple discussions permit uploads, or do they?

    OK, so here's what it looks like:
    The icon's do not even pull off. I can activate the context menu by holding the touchpad button, but if I try to drag an icon off, the icon simply unhighlights and nothing happens.
    @Niel: I tried the defaults write, but didn't help. I find the idea of my son hacking a 'defaults write' command into the Terminal to lock his creative artwork absolutely thrilling, but it's about as improbable as the infinite improbability drive.

  • Dock icons can't be removed

    I have icons for 7 Microsoft apps in my dock that I can't get rid of. I can drag them off to delete, but when I restart or log out/log in they reappear. I've uninstalled all the apps, but now 7 "?"s appear. I've removed my dock preferences and that didn't help. There must be some sort of start-up script/preference, but I can't find it. Any ideas?

    This could be due to MCX policy settings used to manage your dock. These can be used to integrate to Open Directory in an OS X server environment, Active Directory (with the right tools and/or configuration), or other LDAP directories.
    Look for '/Library/Managed Preferences/<yourshortusername>/com.apple.dock.plist' for this one.
    Another possibility is that one of these two locations carries the configuration:
    /Library/Preferences/com.apple.dockfixup.plist
    /System/Library/CoreServices/Dock.app/Contents/Resources/English.lproj/Default.p list
    You can use the plist editor from the XCode toolset or use the 'defaults' command from the command line to edit these.
    My money is on MCX.

  • How Can I Remove A Persistent Icon From Dock

    I've got an app's icon in my dock with a question mark in it.  I am unable to remove the icon from the dock(I should be able to push the icon out with my cursor and have it go "poof" but can't).  I deleted the app from my hard drive but the errant icon persists. I would think that there would be a file in my system  representing the icon but can't locate it.  How can I permanently delete the icon ?

    First, Safe Boot , (holding Shift key down at bootup), use Disk Utility from there to Repair Permissions.
    Then move these files to the Desktop...
    /Users/YourUserName/Library/Preferences/com.apple.finder.plist
    /Users/YourUserName/Library/Preferences/com.apple.dock.plist
    /Users/YourUserName/Library/Preferences/com.apple.systempreferences.plist
    /Users/YourUserName/Library/Preferences/com.apple.desktop.plist
    /Users/YourUserName/Library/Preferences/com.apple.recentitems.plist
    Reboot & test.
    PS. Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive.
    Setup your Dock icons again.

  • Clicking on Dock icon only brings most-recently-used window to front

    In Leopard, clicking on the iChat Dock icon would bring all iChat windows (contact lists, chats, etc.) in front of other open applications, and give focus to the most recently used iChat window.
    After installing Snow Leopard, clicking on the iChat Dock icon only brings the most recently used iChat window to the front and gives it focus -- other iChat windows remain behind other application windows (if that is where they were before).
    Is this just me? My friend tells me that it still behaves like it did in Leopard on his computer. Any ideas?

    In the First Post your Specs said Snow Leopard, now they say Tiger
    Sorry, I didn't realize it wouldn't remember that setting for me -- I am running Snow Leopard.
    With Chax in Leopard/iChat 4 an extra item was added to the Window menu of iChat that says "Always On top"
    No, this is not what I was looking for. I have another machine with Leopard, and it does not have Chax -- iChat windows are not always in front, but they all come to the front when clicking on the Dock icon.
    I don't use it on the Buddy List as you can set it on Any iChat window.
    What do you mean, "you can set it on Any iChat window"? You mean the Chax setting, or something else?
    Are any Minimised to the DOCK ?
    No, none are minimized to the Dock.
    Chax does not work in iChat 5 and may be the cause of the issue.
    There is a beta version of Chax for iChat 5.
    I would delete Chax and then the com.apple.ichat.plist to remove any thing in it that refers to Chax and then relaunch iChat.
    I deleted Chax and every Chax and iChat plist, then restarted my computer. The problem did not go away -- still, only one window comes to the front when I click on the iChat Dock icon -- the others stay behind other windows.

  • My Macbook pro often won't start up since I installed Lion, and I have to shut it down using power button. My desktop icons don't appear and the dock won't open. I only have the little circle of color spinning endlessly. What's wrong now!

    My Macbook pro often won't start up since I installed Lion, and I have to shut it down using power button. My desktop icons don't appear and the dock won't open. I only have the little circle of color spinning endlessly. What's wrong now!

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of this exercise is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login. Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. The instructions provided by Apple are as follows:
    Be sure your Mac is shut down.
    Press the power button.
    Immediately after you hear the startup tone, hold the Shift key. The Shift key should be held as soon as possible after the startup tone, but not before the tone.
    Release the Shift key when you see the gray Apple icon and the progress indicator (looks like a spinning gear).
    Note: If FileVault is enabled under Mac OS X 10.7 or later, you can’t boot in safe mode.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including wireless networking on certain Macs.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem(s)?
    After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test.

  • Remove/Hide Toggle Icon Column in using f:facet name="detailStamp"

    Hi All,
    I am using <f:facet name="detailStamp"> to expand the row with details ,Done that part with separate button programmatically.
    So I need to hide/remove additional toggle icon column in the table...
    JDev 11.1.1.4 and adf faces application...
    Please anybody help.......

    Hi,
    use skinning
    af|table::disclosed-icon      
    Overrides the default disclosed icon used with the detailStamp facet in table.
    af|table::undisclosed-icon      
    Overrides the default undisclosed icon used with the detailStamp facet in table.
    e.g.
    af|table:disclosed-icon(display:none);
    af|table::undisclosed-icon(display:none);
    Frank

  • How to remove dock icon on Mac when main stage is hidden?

    I'm trying to implement a "minimize to system tray" functionality, where when the user closes the app's window, it disappears from the task bar and can be retrieved from the system tray. This works great on Windows and Linux, but on the Mac, the window closes, but the app's icon remains in the dock. Clicking on the dock icon focuses the app, but (perhaps unsurprisingly) does not open the window, which is a pretty bad user experience. Opening the window from the system tray works, so if I could just hide the dock icon I'd be there.
    I found the undocumented PlatformImpl.setTaskbarApplication(false), but it doesn't seem to have any effect. Probably only does something at launch time.
    Bug or feature?
    (I'm using the new Platform.setImplicitExit(false) to keep the app from exiting when the main stage is hidden, but I see the same behavior when using the "create an off-screen dummy stage" kludge in 2.1.)

    Whatever you did last time didn't work - don't try that again!
    Back up everything before you begin.
    Bootcamp Assistant (in Applications/Utilities) will remove Windows partitions, however I expect in this state it will remove the Windows 7 partition. It may resolve the issue, but it will delete all the Windows data. Perhaps Bootcamp Assistant does something extra compared to deleting the partition by hand?
    If it still has the multiple boot icons you will have to erase the HD completely and then restore your OS and user data.
    Do you really want to erase & start over for this minor issue?

  • Default Dock Icons

    How do I change what the default Dock Icons are when a new User adds an account to the Machine?
    I'm setting up a lab of about 50 iMac, each computer will be set to authenticate via a remote Server, once logged in for the first time the computer will create a local profile. I want the default dock on each of these new local accounts to include specific Applications on the computer and remove some of the default Apple ones.
    I tried com.apple.dock.plist but that only exist after the account is created. I need it to do it as the account is created.

    Place the modified com.apple.dock.plist file on the desktop, and then open the Terminal in the /Applications/Utilities/ folder. Run the following commands:
    sudo cp ~/Desktop/com.apple.dock.plist '/System/Library/User Template/English.lproj/Library/Preferences/com.apple.dock.plist'
    sudo chown root '/System/Library/User Template/English.lproj/Library/Preferences/com.apple.dock.plist'
    Each command starts with sudo; the first command will prompt you for your administrator password, which won't appear on the screen while it is being typed.
    (24333)

  • How Can I Remove the Finder Icon From the Dock?

    Hi! Can someone tell me how to remove the Finder icon from the dock? I don't even care if Finder quits. I just want it removed from the dock. I really don't care if I can't get to my files. Please help.

    Start by going to your core services, (/system/library/coreservices). You can do this by pressing Shift+Cmd+G and then paste (/system/library/coreservices), without parentheses.
    After doing this, find Dock.app, right click, show package contents. This doesn't contain the icons on your dock, just finder and trash.
    After that, move all finder services to the desktop, and then erase them from the core services folder. At this point it will prompt you to put in your password, do so.
    Next you'll want to open terminal and type 'killall dock' or, you could restart your computer.
    This should remove the finder icon from your dock, while still giving you access to it from your desktop.
    Hope this helps!
    -C

  • Whilst working on iMovie my screen has frozen. Cannot use any menus or dock icons. Tried turning off but asks am I sure. If I press shut down button it doesn't respond. Any ideas?

    Cannot use any menus or dock icons. Tried turning off computer but message appeared asking 'am I sure'. If I press shut down button it doesn't respond. Any ideas? I was dropping multiple  clips into my movie/project when it happened.  It has been frozen for over an hour now. I can't hear the driving doing any work.

    Thanks a lot. I had previously held the power button down and up popped the 'are you sure' message whhich provided a shut down button to press but it didn't work. Thanks for you help. I'll have a look in iMovie now to see if I've got any corrupted files. Thanks a lot
    Kind regards
    Derek White

Maybe you are looking for

  • Can't speed up read-out-loud speed

    Hi, I'm experiencing the read-out-loud making long pause between words when it is activated. I tried with "Edit=>Preferences=>reading=>words per minute" but it didn't not really work. It only made each word being read faster, but it didn't shorten th

  • SOAP processing failure

    Hello All , I have installed Java and ABAP sneak preview on the same machine . I have also created a service from an existing BAPI 'BAPI_FLBOOKING_GETLIST' and released the service . When I am trying to test this new service from ZICF transaction the

  • Column headings as HTMLDB_ITEMS

    Is there a way to return column headings and HTMLDB_ITEMS? I am trying to place select lists into certain columns to be used as column filters to dynamicly build where clauses.

  • Splitting DATA_TOP to different mountpoints

    Hi, I am doing a single node to multi node clone of Apps. In the database code tree copy I have placed the RDBMS_ORACLE_HOME in /u01 Now I need to evenly split data files across three mount points /u02 , /u03, /u04. How can I achieve this? Can this b

  • Audition doesn't start

    I've recently installed Windows 7 Ultimate 64 bits and installed Adobe Audition CS5.5, when i wanted to start it i get the following error and it doesn't start: I've been searching anywhere for someone with the same problem but no luck. Can someone h