AppleScript code to edit my plist -


using applescript, how can edit key phonenumber new value , delete key useractive?

i have read apple's documentation, did not success. help.

<?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>person</key>     <dict>         <key>adult</key>         <dict>             <key>names</key>             <dict>                 <key>myname</key>                 <dict>                     <key>adress</key>                     <dict>                         <key>profissional</key>                         <dict>                             <key>celnumber</key>                                 <integer>4</integer>                             <key>phonenumber</key>                                 <integer>5</integer>                             </dict>                                  <key>useractive</key>                                 <integer>0</integer>                         </dict>              

for edit plist file it's more simple use /usr/libexec/plistbuddy in script can plistbuddy

  clear type  clears out existing entries, , creates root of type              type.  see below list of types.   print [entry]              prints value of entry.  if entry not specified, prints              entire file. see below explanation of how entry works.   set entry value              sets value @ entry value.   add entry type [value]              adds entry type type , optional value value.  see              below list of types. 

one example see in terminal window : controller:iopcimatch amd5000controller.kext or amdradeonx3000.kext

    tell application "terminal"         activate script "/usr/libexec/plistbuddy -c \"print :iokitpersonalities:controller:iopcimatch \"  /system/library/extensions/amd5000controller.kext/contents/info.plist;   /usr/libexec/plistbuddy -c \"print :iokitpersonalities:amdcedargraphicsaccelerator\" /system/library/extensions/amdradeonx3000.kext/contents/info.plist  " end tell 

Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -