How can I edit a sub key in a plist file?

For example, how could I edit the Name key in the array?
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Test</key>
<array>
<dict>
<key>IPAddress</key>
<string>xxxx</string>
<key>Name</key>
<string>yyyy</string>
</dict>
</array>
</dict>
</plist>

hi,
i guess this article should answer your question
http://www.mactech.com/articles/mactech/Vol.22/22.03/StoringandAccessingData/ind ex.html
quote for items:
set theOutputFolder to path to desktop folder as string
set thePListPath to POSIX path of (theOutputFolder & "myPListFile.plist")
tell application "System Events"
tell property list file thePListPath
tell contents
set value of property list item "keyName" to "New Key Value"
end tell
end tell
end tell
quote for sub-items:
set theOutputFolder to path to desktop folder as string
set thePListPath to POSIX path of (theOutputFolder & "myPListFile.plist")
tell application "System Events"
tell property list file thePListPath
tell contents
set value of property list item "subKeyName1" of property list item
"keyName3" to "New Key Value"
end tell
end tell
end tell
but reading the full article would be the best way to go.
feel free to ask further if it wasn't helpful
Best regards
fidel

Similar Messages

  • How can I edit my iweb published site when the domain file is empty?

    How can I edit my iweb site when the domain file opens up empty? I have the site backed up in mobile me, on my computer, and on an external hard drive.
    How can I transfer these files into iweb?

    Hi there,
    To edit your site from one of your backed up versions, place the Domain file in User>Library>Application Support>iWeb & then launch iWeb. Update & publish.
    Ben

  • How can I use the defaults command to edit a sub key in an array of plist?

    For example, how could I edit the Name key in the array?
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Test</key>
    <array>
    <dict>
    <key>IPAddress</key>
    <string>xxxx</string>
    <key>Name</key>
    <string>yyyy</string>
    </dict>
    </array>
    </dict>
    </plist>

    I realize you are asking specifically about 'defaults', but as they concede in 'man defaults', it may not be the best tool for editing properties in "complex" structures, such as those buried in dicts within arrays, etc.
    As an alternative, it looks like in 10.5, '/usr/libexec/PlistBuddy' is now a part of the standard install - 'PlistBuddy' may be more useful for this sort of task.
    For example:<pre>
    /usr/libexec/PlistBuddy -c "set Test:0:Name zzzz" /path/to/file.plist</pre>

  • How can I edit lightroom 5 smart previews on mac book pro (mbp) when the lightroom 5 master image files are on my external hard drive is disconnected from the mbp

    How can I edit lightroom 5 smart previews on mac book pro (mbp) when the lightroom 5 master image files are on my external hard drive is disconnected from the mbp? So far when I try to disconnect the external HD from the mbp, I get the following pop up window: The disk "external hard drive A" couldn't be ejected because "Lightroom" is using it. Quit that application and try to eject this disk again. When I do that and restart Lightroom 5, the Adobe Photoshop Lightroom - Select Catalog screen pops up but doesn't list my external hard drive A as a choice.
    I've reviewed Adobe's Lightroom Help | Smart Previews Lightroom 5 web page and still haven't been able to figure what I'm doing wrong. Any help would be appreciated.

    Your internal HDD. by default, is named 'Macintosh HD'. From what information you supplied, it looks like there is already a Lightroom catalog installed on you local (internal) HDD using the standard naming convention Adobe uses as well as a Lightroom catalog on your external drive which you created. To be sure of which catalog Lightroom is loading when it starts up, To do this, start Lightroom as you normally would. After it starts, select the Lightroom menu item, then select the Catalog Preferences item and finally, navigate to the General tab. The Location information will tell you exactly what catalog Lightroom is opening by default. This will likely be the Photography Mac Book Pro Versions catalog on your external HDD. Once that is confirmed, you are ready to proceed. As an additional test/verification, you can shut down Lightroom and, this time, start Lightroom while holding down the ALT/OPTION key. This will cause Lightroom to pause and display a screen which will allow you to chose a different catalog to open. Navigate to the /Users/[user name]/Pictures/Lightroom folder and select the Lightroom 5 Catalog.lrcat file. When Lightroom comes up, there should be no previews or folders as this catalog should be empty. Now you can be certain which catalog is being used and which catalog has all your data and you are ready to migrate your current catalog. Shut down Lightroom.
    To migrate your current catalog, use Finder to locate your Photography Mac Book Pro Versions folder on your external drive. Select the folder and select COPY from the context menu. Next, use Finder to navigate to the /Users/[user name]/Pictures/Lightroom folder on you internal HDD. You can start at the Macintosh HD level and work your way down by opening each level (Macintosh HD/Users/[user name]/Pictures). Select the /Pictures folder and then select PASTE... from the context menu. When the COPY/PASTE is complete, you should see the following files on the Macintosh HD:
    Macintosh HD/Users/[user name]/Pictures/Lightroom/ and
    Macintosh HD/Users/[user name]/Pictures/Photography Mac Book Pro Versions
    The Macintosh HD/Users/[user name]/Pictures/Lightroom folder will contain the empty default catalog the Adobe created when Lightroom was installed and Macintosh HD/Users/[user name]/Pictures/Photography Mac Book Pro Versions will contain a copy of the catalog you created on your external HDD.
    You are almost done now. Make sure your external drive is still attached for this step. Restart Lightroom using the ALT/OPTION key again. When the Select Catalog screen appears, select the Choose a Different Catalog button (lower left side). When you do, a Finder window will open to allow you to navigate to a catalog of your choosing. Navigate to Macintosh HD/Users/[user name]/Pictures/Photography Mac Book Pro Versions and select the file Photography Mac Book Pro Version.lrcat. This is the copy you just created. Select the Open button and Lightroom should start. You should see all of your previews and settings just as before. Also, in the left hand panel, all of your folder should show up and none of them should be dimmed and none of your previews should display a small exclamation point badge. Either a dimmed folder name or an exclamation point badge indicates that Lightroom can't find the associated image file. If everything looks good, go to the Lightroom menu, select Preferences and then select the General tab. Under Default Catalog, select an option to either load the LAST catalog opened or select the Users/[user name]/Pictures/Photography Mac Book Pro Versions catalog from the drop down. Shut down Lightroom and then restart it normally. This time, when Lightroom starts, you should be viewing the new copy of your catalog. You can confirm this by looking at the General tab on the Catalog Preferences screen (Lightroom/Catalog Preferences menu items). Shut down Lightroom once again and this time, eject your external drive before restarting. This time, your folders in the left hand panel will be dimmed but you should be able to work with your smart previews. If Lightroom should display a Select Catalog screen with the external drive detached, double check your settings as it indicates Lightroom is still looking at the copy of the catalog on the external drive rather than the new copy you made.
    Finally, if you are seeing dimmed folders and/or exclamation point badges with the external drive attached, this indicates a problem. You can select any folder and select Update Folder Location from the context menu. This will allow you to navigate to the copy on the external drive and select it. Lightroom will then update the catalog (select to synchronize the content). This will not only clear the dimmed folder problem but also remove the exclamation point badges for all photos in that missing folder. However, it may indicate that not all went well with the copy of the catalog so make sure to verify all went well. You can use the Get Info option on the two folders. You should see the same number of files/folders for both the copy on the internal drive as well as on the external drive but you can't rely on the byte count because of the possibility of differences between the geometry of the two drives. Hope this all helps!

  • How can I edit text tabs in Photoshop...?

    how can I edit text tabs in Photoshop like in Illustrator that I can choose to view the tab rulers and edit the alignment on the tabs?
    is it possible? otherwise I can't understand why I can use the tabs at all...
    thanks!

    No, tab-formatted text is not editable in the manner you desire. As for your question - tab is just a character like any other. You are simply taking a given kind of implementation for granted, nothing more, but that must not necessarily be the case for all programs. An evil programmer just could assign the tab key to forward delete or any other fancy function just as he could make your space key draw funky symbols from a different Unicode range, if you get my meaning... so simply take it the way it is. If editable formatting is high on your wishlist:
    http://www.adobe.com/go/wish
    Mylenium

  • How can I edit texts in ipad letter by letter.

    I frequently write in Spanish and English, i have to change the keyboard from one language to the other but when i forget i get unexpected results. I decided to disable the automatic spelling correction. But there is still a problem. I sometimes miss a single letter to correct in a word but ipad forces me to rewrite the whole word again, or to use the delete key to delete all the letters until i get to the one I need to correct. How can I edit letters from inside a word without the need to rewrite the whole word. Does ipad support this?
    Thanks for your comments.

    Yes.  You can tap near the letter you want to edit to place the cursor near by.
    For more accurate selection if you hold down where you want to edit a small magnifiying glass should appear. You can use that to move the insertion pointer to wherever you want to edit.
    Page 24 of the User Guide describes this feature.
    http://manuals.info.apple.com/MANUALS/1000/MA1595/en_US/ipad_user_guide.pdf

  • How can i edit in photoshop elements 10 ?

    HOW CAN I EDIT MY PHOTOS IN PHOTOSHOP ELEMENTS 10 ?   JB     [email protected]

    No, sorry, I don't understand what you are talking about. Exactly what happens? You do not need to buy a different version of Elements, just explain EXACTLY what the problem is. And please turn off your caps lock key.
    Adobe is not preventing you from using PSE 10. Thousands of people are using it, so we need to figure out exactly where the problem lies. Please explain step by step what you are doing and what happens.

  • How can I edit /update windows registry through Dev. 6i Form?

    I want to manipulate windows registry through dev 6i form, i.e. I want to create a new key and assign value to it or want to retrieve a value from registry key, how can I edit /update windows registry through Dev. 6i Form?
    Sincerely,
    Farhan Mazhar

    I dont remeber the exact name but there is a built in package to do that. have a look at the built in packages node in the navigator tree. (Get_var?).

  • How can i disable the Enter key in JTextArea?

    How can i disable the Enter key in JTextArea?
    When i press Enter key in JTextArea,I hope JTextArea do nothing.
    Thanks!

    HI, I've the same problem;
    uncle_alice solution works fine, but if I paste in textArea a multi-line text,
    this last results on more lines (rows);
    Isn't possible to avoid this?
    Alternatively, how can I disable cut/copy/paste on TextArea?
    Thank you in advance.
    MargNat
    Message was edited by:
    MargNat

  • How can i edit contacts in bulk

    Bought an iPhone 5 and transfered contacts from my old phone and my phone contacts first and last name were reversed. How can I edit my address book contacts in bulk instead of one at a time? And then have these updates in my iPhone 5?

    to any1 that wants to use the scripts and have them work just type "save" on the next like after end tell and itll do it........

  • How can I edit multiple clips with different frame rates on the same timeline

    how can I edit multiple clips with different frame rates on the same timeline

    You do not want to edit material from different frame rates on one timeline. You CAN do this, but it is a very bad idea - and this is why.
    Once you establish the sequence frame rate - lets say it is PAL material at 25fps, any material that you drop into the sequence other than 25 fps will have to be changed to play at 25 fps. If the material you add is NTSC (29.97), FCP will DROP 5 frames per sec to bring the frame rate down to 25 fps. Which 5 get thrown away? Every 6th one. This yields a funky cadence that becomes even more complex as as there are also interlaced fields (DV/NTSC is an interlaced format). Oh, and by the way, the image sizes are different as well. DV/PAL has 576 lines of resolution and DV/NTSC has 480. FCP has to scale up the NTSC to fit the PAL frame.
    You do not want FCP adjusting these things on the fly. You want to do a thoughtful (and time consuming) conversion so that you end up with all your material in one format with the best possible image from the conversion process. Compressor can do an adequate job with Frame Controls turned on. The Natress Standards Conversion FCP plugin is another way to go. A third option is to find a post house that can do the conversion for you using a hardware based process.
    The good news is, once everything is in the same format, editing it will be painless and the output process very quick.
    Whatever frame rate/ image size you select, I'd suggest using ProRes for the codec. It is 4:2:2 color and will withstand color correction and composting with much more grace than any variant of DV based codecs.
    Have fun.
    x

  • How can I edit photos in iPhoto in Photoshop Elements?  I select PE in iPhoto preferences but they stay in iPhoto for editing.

    How can I edit photos in iPhoto in Photoshop Elements?  I select PE in iPhoto preferences but they stay in iPhoto for editing.

    Here's something you can try with a copy of your current library.
    1 - go to iPhoto's Events preference pane and set the auto split option to 1 day per even.
    2 - go the the Events mode, select all Events.
    3 - go to the Events menu  and and select Autosplit Selected Events.
    which will give you an event for each day.
    4 - again select all events (although it might be better do to fewer at a time) and export them to your desired destination via the File ➙ Export ➙ File Export  menu option with the following settings:
    The workflow above will produce a folder for each days photos with the date as the folder's title.

  • How can I create a sub-iTunes account for a teen?

    how can I create a sub-iTunes account for a teen?
    I need to separate our music libraries but still keep it under control from the main account (mine).

    iOS 5 & iCloud Tips: Sharing an Apple ID With Your Family

  • How can I edit my website from another computer? and how can I create a new website next to the one, I have already? Can anyone help, please?

    How can I edit my website from another computer? and how can I create a new website next to the one, I already have? Can anyone help, please?

    Move the domain.sites file from one computer to the other.
    The file is located under User/Library/Application Support/iWeb/domain.sites.  Move this file to the same location on the other computer and double click and iWeb will open it.  Remember, it is your User Library that you want and not your System Library, as you will not find iWeb there.
    Just create a new site on the same domain file and it will appear below the other site.  If you want them side by side then duplicate your domain file and have one site per a domain file and they can then be side by side.

  • Set up apple Id with invalid email so can't validate new account. How can I edit account  info when I can't sign in for anything? Thx

    Set up apple Id with invalid email so can't validate new account. How can I edit account  info when I can't sign in for anything? Thx

    Hi Franklin777,
    If you are having issues with your Apple ID, this article will get you started.
    Frequently asked questions about Apple ID
    The first step is to find and edit the Apple ID you created:
    Apple ID: Finding your Apple ID
    If you need to reset your security questions this article will help ... 
    The rescue email address is a different address than the one you use for your Apple ID. 
    Rescue email address and how to reset Apple ID security questions
    You can edit or delete your rescue email address at My Apple ID. To edit your rescue email address:
    Navigate to My Apple ID using your web browser.
    Click "Manage your account"
    When prompted, sign in using your Apple ID and password.
    Click Password & Security
    You'll be asked to answer 2 of your 3 security questions before you can make any modifications. If you are unable to remember your answers, you can choose to send an email to your rescue email to reset your security questions.
    Hope you get back on track soon!
    - Judy

Maybe you are looking for