Re: XML - System Events vs XMLlib
Re: XML - System Events vs XMLlib
- Subject: Re: XML - System Events vs XMLlib
- From: "Stockly, Ed" <email@hidden>
- Date: Thu, 30 Aug 2007 10:33:00 -0700
- Thread-topic: XML - System Events vs XMLlib
>me>> set text item delimiters to "<string>"
>>gary>>This is exactly the wrong way to approach XML and XML-like structured
documents.
>>>>Sure, this kind of scripting can get the data, but it's a lot of clutter for
no benefit. It's too specific to be a useful suggestion for any real scripting
of XML extraction.
In the world of Application scripting that kind of solution is often just
what's needed. Extraction of a small bit of data from either an XML,
property list, Database file, jpg, tagged text, HTML or whatever. As in the
sample provided, sometimes the data isn't properly formatted. Sometimes
there is no tool to read file. Sometimes it's just faster, simpler and
makes sense to call a short and suite applescript handler to read one value
in a large file.
That said...
>> How to I search for "happy" and return "false"?
>has>>
> tell application "System Events"
> tell contents of property list file "/path/to/your.plist"
> {value of property list item "creation", value of property list
> item "happy"}
> end tell
> end tell
> --> {"2007:06:12 20:13:52", false}
That has rendered a big part of this discussion moot.
That sort and simple appleScript handler could just as easily call system
events as invoke tids and standard additions. (I've been using tids for xml
since OS9 and it's probably time for me to update.)
The other part of the discussion that Wayne has brought up, as did Has in an
earlier thread, is something that I think just about everyone can agree on"
There should be a collection of simple, easy to understand, working
AppleScript samples that make arriving at a solution like Has' as easy as it
should be.
ES
_______________________________________________
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