Plist parsing

How can i parse plists and find what is value of certain key in plist? For instance in com.apple.Safari.plist to test is AlwaysShowTabBar Keys Value YES or NO? I think plists can be binary or ascii or xml so script should work in all three.

Thanks

If you’re using Tiger, it’s this simple:


tell application "System Events" to return the value of property list item "AlwaysShowTabBar" of property list file ((path of preferences folder) & "com.apple.Safari.plist")

I got an error at “value”… Seems that AS doesn’t find the identifier…

What may it be?

tyraenor, do you know if that key exists in your file?

There have been some recent threads related to this:
Plist items with special characters [Shell quoting/escaping]
Changing plist item

It shows true if you have it selected, but doesn’t appear if not.