Re: Applescript & Final Cut Server & XML
Re: Applescript & Final Cut Server & XML
- Subject: Re: Applescript & Final Cut Server & XML
- From: "Steven D. Majewski" <email@hidden>
- Date: Wed, 26 May 2010 12:47:12 -0400
On May 26, 2010, at 11:31 AM, Martin Michel wrote:
Hi Steve,
The whole "data world" of our company is XML based, so I wrote
myself a small utility to retrieve informations from XML files using
XPath expressions:
http://macscripter.net/viewtopic.php?id=28646
Maybe you can also make use of it.
There is also a perl xpath script in /usr/bin ( in 10.5.x -- don't
know when it first appeared.)
tmp$ xpath
Usage:
/usr/bin/xpath [filename] query
If no filename is given, supply XML on STDIN.
So on your example file, you can do something like:
tmp$ xpath asx.xml '/session/values/value[@id="CUST_SIZE"]/bigint/
text()'
Found 1 nodes:
-- NODE --
362716863
The "-- NODE --\n" goes to stderr.
The value goes to stdout.
So you can grab it as the result of a 'do shell script' .
Note: it's only Xpath 1.0, [ not 2.0 ] and it doesn't parse a few
complex 1.0 expresssions,
but it's great and simple to grab a value from an xml file.
( However, if you've got to grab several values from a big XML file,
it's going to
reparse the XML on each invocation, which is not very efficient. )
-- Steve Majewski
Am 25.05.2010 um 23:29 schrieb Steve Thompson:
Hi all,
I've been hacking AppleScript for years now - quite successfully,
but I'm just that, a hack, working in post-production and using AS
to automate various post-production tasks.
I'm curious to know if anyone else is using AppleScript in
conjunction with Final Cut Server and/or XML processing.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (applescript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
_______________________________________________
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