Re: Getting started with XML?
Re: Getting started with XML?
- Subject: Re: Getting started with XML?
- From: Michelle Steiner <email@hidden>
- Date: Wed, 7 Feb 2007 10:56:58 -0700
On Dec 7, 2006, at 3:10 PM, Christopher Nebel wrote:
Don't forget that if the XML file you're dealing with is a plist,
then you ought to be using the Property List Suite instead. It's
easier to work with, and there's no guarantee that a plist is XML.
As it turns out, it is a plist, although the file extension is .xml.
It's a playlist from iTunes.
property plistFile : missing value
if plistFile is missing value then set the plistFile to choose file
tell application "System Events"
set foo to contents of property list file (path of plistFile)
properties of property list item "tracks" of foo
end tell
This gives me a list of all the data in the file, but I can't figure
out how to extract that data.
If I change properties to |name|, I get
"Dora:Users:michelle:Desktop:running.plist"
"System Events got an error: Can't make |name| of property list
item \"tracks\" of contents of property list file
\"Dora:Users:michelle:Desktop:running.plist\" into type reference."
If I use name, I get "tracks" which is the name of the property, but
that's not what I want to get.
If I use |name| of value
"Dora:Users:michelle:Desktop:running.plist"
"System Events got an error: Can't make |name| of value of property
list item \"tracks\" of contents of property list file
\"Dora:Users:michelle:Desktop:running.plist\" into type reference."
I'm stuck.
-- Michelle
--
SNAFU is not just a saying; it's how things really are.
_______________________________________________
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/mailman//archives/applescript-users
This email sent to email@hidden