Re: PlistBuddy - How to get the whole set of key's
Re: PlistBuddy - How to get the whole set of key's
- Subject: Re: PlistBuddy - How to get the whole set of key's
- From: Jerry Krinock <email@hidden>
- Date: Thu, 30 Dec 2010 14:19:59 -0800
On 2010 Dec 29, at 02:02, René v Amerongen wrote:
> Using PlistBuddy for more then a year or so, I am still curious how to get a complete list of key's from a plist. I need that inside a bash script to run from xcode.
Here are several more alternatives for read/writing free-standing plist files with a script.
First of all, there are at least two ways to access plist files via AppleScript. You can put AppleScript commands into a bash script using the osascript tool. Example:
osascript -e "tell application \\"Whatever.app\\" to do whatever"
The backslash escapes get pretty hairy, though. Maybe the above needs triple instead of double. I forgot.
Then, you'll use one of these…
* A freeware Scripting Addition called "Property List Tools" available from Late Night Software. I've never used it myself, but here's the link:
http://www.latenightsw.com/freeware/PListTools/index.html
* Brian Webster's Plist Edit Pro is AppleScriptable.
If you'd rather bypass the AppleScript and go direct, you could write and compile your own tool and put it in your bash "path". It's fairly trivial using Foundation. I've attached the source code for two tools, 'plistread' and 'plistwrite', which I use in my building and shipping scripts, for example to read a product's version from its Info.plist. I don't think that plistread gives a complete list of keys as you desire, but you could easily modify it to do that.
Attachment:
plistread.m
Description: Binary data
Attachment:
plistwrite.m
Description: Binary data
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden