2016-11-06 4 views
0

AppleScriptを使用して、PhoneNumberキーを新しい値に編集し、キーUserActiveを削除するにはどうすればよいですか?私のplistを編集するAppleScriptコード

アップルのドキュメントを読んだことがありますが、何も成功しませんでした。手伝ってくれてありがとう。ターミナルウィンドウに表示するために編集plistファイル用

<?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>    

答えて

0

はそれが

Clear type Clears out all existing entries, and creates root of type 
      type. See below for a list of types. 

Print [entry] 
      Prints value of entry. If an entry is not specified, prints 
      entire file. See below for an explanation of how entry works. 

Set entry value 
      Sets the value at entry to value. 

Add entry type [value] 
      Adds entry with type type and optional value value. See 
      below for a list of types. 

一例PlistBuddyとすることができますスクリプトでの使用は/ usr/libexecに/ PlistBuddyもっと簡単です:コントローラ:AMD5000Controller.kextからIOPCIMatchまたはAMDRadeonX3000.kext

tell application "Terminal" 
     activate 
do 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 
+0

のtellアプリケーション "ターミナル" "/ usr/libexec/PlistBuddy -c \" Print:IOKitPersonalities:コントローラ:IOPCIMatch \ "/System/Library/Extensions/AMD5000Controller.kext/Contents/info.plist;\t activate \t \tスクリプトを実行します。/usr/libexecに/ PlistBuddy -c \ "印刷:IOKitPersonalities:AMDCedarGraphicsAccelerator \" /System/Library/Extensions/AMDRadeonX3000.kext/Contents/info.plist 」 \t \t \t終わりがわかりました – deek5

+0

を教えて、私はこれを試してみます。 – robert

0
tell application "Terminal" 
activate 
do 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 
+0

端末ウィンドウで見るための一例コントローラ:AMD5000Controller.kextまたはAMDRadeonX3000.kextのIOPCIMatch IOKitPersonalities – deek5

関連する問題