Best way to delete a .plist item?

Hi everyone!
I have found similar topics on this...but maybe someone can clear it up for me?
I want to delete an item within a .plist, specifically to remove an item from the Dock by scripting. (See com.apple.dock.plist) If I use System Events I can take one of the "Dictionary" types with a number under persistent-apps and delete the value so basically it works...it's just I leave the empty line with the number there. Using "defaults delete" I can't seem to access this item...maybe it's too deeply nested or I just don't have the syntax right? And I'm not sure about Cocoa? I'm using Applescript Studio...
I can search using System Events and find all the needed info I'm looking for...I just can't find a simple way to say delete the entry!
Thanks in advance,
Reg

Hi guys!
Thanks for the reply!
I have read that post that you suggested and it actually does a good job. I'm just trying to avoid using plist buddy as I don't know for sure if a computer will have it for sure to be able to use its functions...
I have read the "man defaults" page and I can't seem to get the syntax right! Either that or it's not possible? For example:
delete domain key
Removes the default named key from domain.
But I can't seem to delete anything that's nested beyond that first key? I've read that defaults can't handle deeply nested items well, and in this case I just need to go one more step. (In com.apple.dock.plist "persistent-apps" is the key which contains dictionary entries 0 through however many apps are in your dock. I need to be able to delete one of those entries by scripting somehow.)
Thanks for the help! Any more ideas?
Reg

Similar Messages

  • Best way to delete transcoded and proxy media?

    Hello,
    I am trying to free up some disc space and am curious what is the best way to delete transcoded and proxy media in fcpx?  I know I can open up a library bundle and delete the folder, but is this safe?  There must be a better option...
    Thanks,
    Austin

    Austin Samuel wrote:
    Hello,
    I am trying to free up some disc space and am curious what is the best way to delete transcoded and proxy media in fcpx?  I know I can open up a library bundle and delete the folder, but is this safe?  There must be a better option...
    Thanks,
    Austin
    I don't know of any other way.
    Proxy and Transcoded media can always be re-generated if the original files are in place.
    If this question refers to your system drive then a BIG suggestion is to aquire a fast dedicated media drive.
    Al

  • What is the BEST way to delete an app on an iPhone 4S so it will NOT be added back when I sync with iTunes?

    What is the BEST way to delete an app on an iPhone 4S so it will NOT be added back when I sync with iTunes?

    To completely remove an app and all of its data, do this: First delete the app on your phone, then in iTunes, under Library, click on Apps, right-click the app you want to delete & select delete, when prompted, move all files to trash, empty your trash. Connect your phone and sync. The app and all of its data will be gone.

  • I own CS4, upgraded to CS5, then joined CS6, CC... and now I installed CC14. Which will be the best way to delete or uninstall the programs I don't need keeping only CC14 without running into issues? I have an Alienware Area 51 PC running Windows 7.

    I own CS4, upgraded to CS5, then joined CS6, CC... and now I installed CC14. Which will be the best way to delete or uninstall the programs I don't need keeping only CC14 without running into issues? I have an Alienware Area 51 PC running Windows 7.

    Which will be the best way to delete or uninstall the programs I don't need keeping only CC14 without running into issues?
    There is none. Whatever you do to get rid of the older versions will inevitably do damage to shared components and other stuff of the new versions as well. That's just how it is with this approach... Uninstall the older versions, run the cleaner tool then reinstall CC 2014.
    Use the CC Cleaner Tool to solve installation problems | CC, CS3-CS6
    Mylenium

  • What is the best way to delete MacKeeper?

    I installed MacKeeper last year in an attempt to free up some hard drive space on my former hard drive. I now have a new SSD and have no need for MacKeeper. In addition, I see that this programme attracts a lot of negative press.
    What is the best way to delete MacKeeper from my hard drive and Time machine?

    Remove the "MacKeeper" crapware as follows. First, back up all data.
    "MacKeeper" has only one useful feature: it deletes itself.
    Note: These instructions apply to the version of the product that I downloaded and tested in early 2012. I can't be sure that they apply to other versions.
    IMPORTANT: "MacKeeper" has what the developer calls an “encryption” feature. In my tests, I didn't try to verify what this feature really does. If you used it to “encrypt” any of your files, “decrypt” them before you uninstall, or (preferably) restore the files from backups made before they were “encrypted.” As the developer is not trustworthy, you should assume that the "decrypted" files are corrupt unless proven otherwise.
    In the Finder, select Go ▹ Applications from the menu bar, or press the key combination shift-command-A. The "MacKeeper" application is in the folder that opens. Quit it if it's running, then drag it to the Trash. You'll be prompted for your login password. Then a dialog will pop up asking why you want to uninstall it. You don't have to provide that information. Enter anything you like in the text box, then click the Uninstall MacKeeper button. All the functional components of the software will be deleted. Reboot.
    Do not try to uninstall by dragging the MacKeeper icon in the Dock or the LaunchPad to the Trash.
    Here are some general suggestions. If you want your computer to be usable, don't install crapware, such as “themes,” "haxies," “add-ons,” “toolbars,” “enhancers," “optimizers,” "tune-ups," “accelerators,” “extenders,” “cleaners,” “defragmenters,” “firewalls,” "barriers," “guardians,” “defenders,” “protectors,” most “plugins,” commercial "virus scanners,” "disk tools," or "utilities." With very few exceptions, this kind of material is useless, or worse than useless.
    The more actively promoted the product, the more likely it is to be garbage. The most extreme example is the “MacKeeper” scam.
    The only software you should install is that which directly enables you to do the things you use a computer for — such as creating, communicating, and playing — and does not modify the way other software works. Never install any third-party software unless you know how to uninstall it.

  • What is the best way to delete applications?

    I am told that my Mac came with everything I need in the way of programs for basic functions.  What is the best way to delete applications making sure there are no threads left in Library and other places?

    Yes, but not always. An example of what I call "System" files/folders would be Quicktime or things like pre-installed print and scanner drivers. You have to be pretty confident to go rummaging through files in either /System or /Library. Most of the time there is no reason to be in there.
    An example of a file that is in those system folders, that does not come pre-installed as of Lion, is Flash plug-ins. That gets installed in the /Library/Internet Plug-Ins
    But your average App downloaded from the MAS, most of it's files will be in the User Folder   ~/username

  • Given ipod from someone best way to delete their music and add to my apple id

    Have been given ipod from someone what is best way to delete their music and then sync to my itumes and apple id

    Hi Caz0,
    You might want to try to factory reset the iPod to wipe it completely. Here's a link on how to do it: http://support.apple.com/kb/ht1339
    As far as I'm aware an iPod Classic isn't tied to an Apple ID, therefore all you need to do is factory reset the iPod, sync your music library and plug in headphones, and you're ready to go!
    Good Luck,
    Stefan

  • Time Machine Backup is Full, best way to delete?

    Hi,
    I'm stuck in this problem. Few days ago my TM told me that it didn't have the required space to make a backup which I though was odd because it has always automatically removed older backups to make room for new ones. But not this time.
    Which means I need to manually delete some backups. What is the best way to do it?
    I marked some of them and pressed command+backspace to delete them put they ended up in my trash so when I tried to empty my trash it tells me I have 1 306 229 objects to delete and this is probably gonna take weeks.
    Can someone help me with this?

    Time Machine should normally remove old items from the backup to make room for new. If it is unable to do that, it could be because your backup drive is not large enough for what you're backing up. TM needs a minimum of 2-3 times more space for the backups as what is being backed up. There could also be something wrong with your backup, in which case you could visit the [Time Machine Troubleshooting guide|http://discussions.apple.com/thread.jspa?threadID=2057525].
    Unfortunately, since you deleted stuff from your Time Machine backup in the Finder (from the sounds of it), it's too late for any troubleshooting. You have destroyed your backup, and will have to erase the backup drive and start from scratch.

  • Best way to delete large number of records but not interfere with tlog backups on a schedule

    Ive inherited a system with multiple databases and there are db and tlog backups that run on schedules.  There is a list of tables that need a lot of records purged from them.  What would be a good approach to use for deleting the old records?
    Ive been digging through old posts, reading best practices etc, but still not sure the best way to attack it.
    Approach #1
    A one-time delete that did everything.  Delete all the old records, in batches of say 50,000 at a time.
    After each run through all the tables for that DB, execute a tlog backup.
    Approach #2
    Create a job that does a similar process as above, except dont loop.  Only do the batch once.  Have the job scheduled to start say on the half hour, assuming the tlog backups run every hour.
    Note:
    Some of these (well, most) are going to have relations on them.

    Hi shiftbit,
    According to your description, in my opinion, the type of this question is changed to discussion. It will be better and 
    more experts will focus on this issue and assist you. When delete large number of records from tables, you can use bulk deletions that it would not make the transaction log growing and runing out of disk space. You can
    take the table offline for maintenance, a complete reorganization is always best because it does the delete and places the table back into a pristine state. 
    For more information about deleting a large number of records without affecting the transaction log.
    http://www.virtualobjectives.com.au/sqlserver/deleting_records_from_a_large_table.htm
    Hope it can help.
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • What is the best way to delete dynamically-generated symbols from another symbol?

    in the onClick handler for 1 symbol, I have:
    var sandwhichQty1 = sym.createChildSymbol("sandQty1", "Stage");
    another symbol inside sandQty1 has the onClick method:
    this.deleteSymbol();
    which works fine, deleting sandQty1. I'd like to delete it, and others, from another button, in the circumstance where users don't close them this way.
    I notice that id and class are dynamically assigned to the child symbol, which makes it hard for me.
    any ideas?

    Hi, I did it in this way, and functions well; maybe this is not the best way, but worked for me. Obviously this code is based on the elainafineell's correct solution.
    This is my scenario:
    In a Trigger @ xxxxms there is that:
    var i = 1;
    $.each(results, function(index, element)
         var s = sym.createChildSymbol("mySymbol", "someContainer");
         // some code here
         // Creating the variable that save my new instance of mySymbol
         sym.setVariable("var_id"+i, s);
         i++;
    // a global var, take care with the name
    numOfInstances = i;
    Then, in a click action of some button, symbol, anything that support an action, I code this:
    sym.eraseSymInstance();
    And, in the creationComplete, I code the function like this:
    sym.eraseSymInstance = function()
              for(var i = 1; i <= numOfInstances; i++)
                             var s = sym.getVariable("var_id"+i);
                             s.deleteSymbol();
    For me function well.
    I hope this can be usefull for somebody else.

  • What's the best way to delete 2.4 million of records from table?

    We are having two tables one is production one and another is temp table which data we want to insert into production table. temp table having 2.5 million of records and on the other side production table is having billions of records. the thing which we want to do just simple delete already existed records from production table and then insert the remaining records from temp to production table.
    Can anyone guide what's the best way to do this?
    Thanks,
    Waheed.

    Waheed Azhar wrote:
    production table is live and data is appending in this table on random basis. if i go insert data from temp to prod table a pk voilation exception occured bcoz already a record is exist in prod table which we are going to insert from temp to prod
    If you really just want to insert the records and don't want to update the matching ones and you're already on 10g you could use the "DML error logging" facility of the INSERT command, which would log all failed records but succeeds for the remaining ones.
    You can create a suitable exception table using the DBMS_ERRLOG.CREATE_ERROR_LOG procedure and then use the "LOG ERRORS INTO" clause of the INSERT command. Note that you can't use the "direct-path" insert mode (APPEND hint) if you expect to encounter UNIQUE CONSTRAINT violations, because this can't be logged and cause the direct-path insert to fail. Since this is a "live" table you probably don't want to use the direct-path insert anyway.
    See the manuals for more information: http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9014.htm#BGBEIACB
    Sample taken from 10g manuals:
    CREATE TABLE raises (emp_id NUMBER, sal NUMBER
       CONSTRAINT check_sal CHECK(sal > 8000));
    EXECUTE DBMS_ERRLOG.CREATE_ERROR_LOG('raises', 'errlog');
    INSERT INTO raises
       SELECT employee_id, salary*1.1 FROM employees
       WHERE commission_pct > .2
       LOG ERRORS INTO errlog ('my_bad') REJECT LIMIT 10;
    SELECT ORA_ERR_MESG$, ORA_ERR_TAG$, emp_id, sal FROM errlog;
    ORA_ERR_MESG$               ORA_ERR_TAG$         EMP_ID SAL
    ORA-02290: check constraint my_bad               161    7700
    (HR.SYS_C004266) violatedIf the number of rows in the temp table is not too large and you have a suitable index on the large table for the lookup you could also try to use a NOT EXISTS clause in the insert command:
    INSERT INTO <large_table>
    SELECT ...
    FROM TEMP A
    WHERE NOT EXISTS (
    SELECT NULL
    FROM <large_table> B
    WHERE B.<lookup> = A.<key>
    );But you need to check the execution plan, because a hash join using a full table scan on the <large_table> is probably something you want to avoid.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Best Way To Set values In Items

    Hello,
    I have a two database items and dynamically I would like to assign values to those items.
    What is the best way of accomplishing this task?
    Is there any SET property available or I need to like
    block_name.item_name :='Value'
    Regards

    You can use COPY built-in to perform dynamically assign values to different items.

  • Best way for: OutlineView + icon (for items)

    Hi,
    I have extensively searched, in the cocoa documentation a way to create a display a hierarchical collection of items, each having a corresponding icon.
    Bottom line, the best way of representing it is what mail does with your mailboxes and folders, or what the finder does with the folder tree of the drives.
    One "reasonable solution" I have tried is, through the delegate, returning always the same instance of NSBrowserCell.
    // In my outlineViewDelegate
    - (NSCell *)outlineView:(NSOutlineView *)outlineView dataCellForTableColumn:(NSTableColumn *)tableColumn item:(id)item
    if (tableColumn == nil)
    return thecell; // Assume it is an instance of NSBrowserCell initialized in the init methode of my NSOutlineViewDelegate
    else
    // there is no else. It won't be called. It never has been since I began experementing with it.
    [throw exception]; // assume this works
    Then, I change the icon of the cell as required
    // In my outlineViewDelegate
    - (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell
    forTableColumn:(NSTableColumn *)tableColumn item:(id)item
    NSImage* icon = [find appropriateIconForItem:item]; // assume it works
    [(NSBrowserCell*)cell setImage:icon];
    Everything works, but I am not satisfied with the display.
    1. When a row is selected, the color effect of the selection breaks at the cell boundaries. NSBrowserCell does not show represent the selection the same way that the outline view does.
    2. Spacing between items (vertically) is not good.
    3. If I change it, (by means of the delegate) I loose the settings NSSmallControlSize that I did define at the beginning.
    I have been messing around with the settings without managing to have something as nice as mail.app or the finder.
    I am also willing to try other approach, but I ma not fond of subclassing madly everything, especially if it results in a loss of functionalities (e.g. loosing the editability of the text, or having it edit with a shift in position)
    I post this message because I imagine there is an elegant way of doing it. It is a common functionality after all, used in many native MACOS app (finder, mail, itunes, ...) So it should come for free, right ?
    Anyway, any working fast solution, (my app may have to display very heavy collections, is more than welcome.
    Thanks for reading me.

    Any idea anyone ?

  • What is the best way to remove these unwanted items in PS CS5

    I have used the lasso tool.  I want to remove the power pole and the street sign.  If I use the lasso tool the letters behind the items are removed also.  What is the best way to do this.
    I know that I was sent a link to a video to show how to take two pictures from two angels  and merge them.  At this time I only have the one picture.
    thank you
    Mike

    function(){return A.apply(null,[this].concat($A(arguments)))}
    JJMack wrote:
    Adding empty Layers
    Cloning into the empty layers with ptotective selections
    Slections copy paste transform
    Bluing smudging paint
    You may come up with someting
    First thing you should do is to discard your phone an get a real camera
    Cover up
    JJ,
    I'm in the learning process and want to learn how you removed those items.  The steps in your post are they the ones I should follow and learn or are there additional steps that you took.  What information will be helpful and I will go from there to find the info.
    thanks
    Mike
    Also it would be nice to know how you did your animation.

  • What is the best way to delete folders and collections from Library?

    I have approximately 500 photographs in folders and collections. Want to delete them and start over. What is the best way to go back to Lightroom 5 cc as it was when initially downloaded?
    Using Mac running Maverick.
    Thanks for your help

    File>New Catalog and start over.
    The 500 images will stay put where they are and you can choose to import them again into the pristine catalog.

Maybe you are looking for