Re: XML parsing from AppleScript (Kumar Shailove)
Re: XML parsing from AppleScript (Kumar Shailove)
- Subject: Re: XML parsing from AppleScript (Kumar Shailove)
- From: "J. Stewart" <email@hidden>
- Date: Wed, 24 Jan 2007 05:58:13 -0500
On 1/23/07 at -0500 tom wible said this
>i'm surprised no one's mentioned tiger's built-in XML parsing...here's the code
>i use to parse tivo info files:
>
>try
> set tivoFile to POSIX file tivoFile
> set tivoFile to tivoFile as Unicode text
>
> tell application "System Events"
> set theXML to contents of XML file tivoFile
> set tivo to XML element "TvBusMarshalledStruct:TvBusEnvelope" of theXML
> set startTime to value of XML element "startTime" of tivo
> set stopTime to value of XML element "stopTime" of tivo
> set showing to XML element "showing" of tivo
> set channel to value of XML element "displayMajorNumber" of ¬
> XML element "channel" of showing
> set prog to XML element "program" of showing
> set progTitle to value of XML element "title" of prog ¬
> & " #" & channel as string
> set episodeTitle to ""
> try -- optional entry
> set episodeTitle to value of XML element "episodeTitle" ¬
> of prog
> end try
> set descr to ""
> try -- optional entry
> set descr to value of XML element "description" of prog
> end try
> end tell
>on error emsg
> display alert "parsing tivoXML: " & fileName & return & emsg
>end try
>
Ok I'll bite, where are you getting the TiVo info file from?
As an aside, have you managed to hack your TiVo with a Mac?
JBS
--
Hard work pays off in the future. Laziness pays off now.
_______________________________________________
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