• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: XML parsing from AppleScript (Kumar Shailove)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XML parsing from AppleScript (Kumar Shailove)


  • Subject: Re: XML parsing from AppleScript (Kumar Shailove)
  • From: tom wible <email@hidden>
  • Date: Tue, 23 Jan 2007 21:15:00 -0500

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


_______________________________________________ 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
  • Follow-Ups:
    • Re: XML parsing from AppleScript (Kumar Shailove)
      • From: "J. Stewart" <email@hidden>
  • Prev by Date: Mark Pinson is out of the office.
  • Next by Date: Can't Move App to new computer
  • Previous by thread: Mark Pinson is out of the office.
  • Next by thread: Re: XML parsing from AppleScript (Kumar Shailove)
  • Index(es):
    • Date
    • Thread