Re: Satimage XMLLib.osax
Re: Satimage XMLLib.osax
- Subject: Re: Satimage XMLLib.osax
- From: Jim Skibbie <email@hidden>
- Date: Fri, 10 May 2013 13:14:18 +0000
- Thread-topic: Satimage XMLLib.osax
Satimage's XMLLib is awesome. We use it extensively for parsing XML
responses from our MIS. The XPath syntax gets a little getting used to,
but if you get the hang of that, you can pretty much parse anything. A
real stumbling block can be namespaces, so make sure you are accounting
for them. If you have an example XML, I'd be happy to demo a short code
snippet.
As for parsing plists, you may want to check out the built in Unix
executable called PListBuddy
(http://developer.apple.com/library/mac/#documentation/Darwin/Reference/Man
Pages/man8/PlistBuddy.8.html)
With PListBuddy, you can set or print any value, even from complex plist
structures. Plus, you don't have to worry about having an OSAX installed.
set theShellCommand to "/usr/libexec/PListBuddy -c 'Print
:CFBundleDisplayName' '/Applications/TextEdit.app/Contents/Info.plist'"
set y to do shell script theShellCommand -- "TextEdit"
>Date: Fri, 03 May 2013 23:56:30 -0500
>From: Christopher Stone
>Subject: Satimage XMLLib.osax
>
>Hey Folks,
>
>Periodically I've asked for a couple of simple usage examples of the
>Satimage XMLLib.osax, because every time I look at the dictionary my head
>hurts.
>
>Unfortunately I don't find many useful examples anywhere, and the
>tutorials on the Satimage site are broken.
>
>Today I needed to yank some info out of an application's Info.plist and
>thought I'd give it another try ‹ I was pleasantly surprised to get
>something simple working without too much effort.
>
>Select an application in the Finder and run the script to display three
>specific keys from its Info.plist file, and a listing of key-names and
>key-values.
>
>I dislike using System Events to parse Plists (or for any other job),
>because it can take up to 3 seconds on my machine to launch (and
>occasionally longer) - which is utterly ridiculous for a little 800K
>application on an i7 MacBook Pro.
>
>I want to learn how to use the XMLLib.osax to parse html as well, and I'd
>be glad to have some simple examples if someone has any.
>
>Also: this link is dead. If anyone has this script I'd love to have a
>copy.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden