Hello,
I need to read a plist file and search for a string, then add a new line of text on the next line. I can't imagine it will take much to do this. However the plist is in binary format so not exactly sure how to deal with that.
Thanks in advance,
Aaron
#Convert plist to XML
os.system('plutil -convert xml1 com.apple.iChat.Jabber.plist')
AutoDiscovery = "<integer>0<integer>"
import fileinput
for line in fileinput.FileInput("com.apple.iChat.Jabber.plist",inplace=1):
line = line.replace("<key>AutoDiscoverHostAndPort</key>",AutoDiscovery)
print line,
#Concert plist to binary file
os.system('plutil -convert binary1 com.apple.iChat.Jabber.plist')