Ho uno script che sta passando valori a un plist, funziona bene, ma vorrei cambiare alcuni valori senza rimuovere tutto il resto. Avevo uno script per questo ma non riesco a trovarlo affatto.
Ecco il mio script che crea il valore
tell application "System Events"
set the parent_dictionary to make new property list item with properties {kind:record}
set the plistfile_path to "~/Desktop/MY_DATA.plist"
set this_plistfile to ¬
make new property list file with properties {contents:parent_dictionary, name:plistfile_path}
make new property list item at end of property list items of contents of this_plistfile ¬
with properties {kind:string, name:"thename", value:theName}
make new property list item at end of property list items of contents of this_plistfile ¬
with properties {kind:string, name:"creationDate", value:creationDate}
make new property list item at end of property list items of contents of this_plistfile ¬
with properties {kind:string, name:"serialNumber", value:serialNumber}
make new property list item at end of property list items of contents of this_plistfile ¬
with properties {kind:string, name:"Email", value:fullEmail}
make new property list item at end of property list items of contents of this_plistfile ¬
with properties {kind:string, name:"IPAddress", value:IPAddress}
end tell
ecco cosa ho scritto per modificare il valore, ma il problema è che il plist avrà solo il nuovo valore e tutte le altre proprietà saranno rimosse
set theName to "demo"
tell application "System Events"
set the parent_dictionary to make new property list item with properties {kind:record}
set the plistfile_path to "~/Desktop/MY_DATA.plist"
set this_plistfile to ¬
make new property list file with properties {contents:parent_dictionary, name:plistfile_path}
make new property list item at end of property list items of contents of this_plistfile ¬
with properties {kind:string, name:"thename", value:theName}
end tell
come posso modificare parte del valore senza rimuovere gli altri?