• 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: How to work with XML data using System Events?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to work with XML data using System Events?


  • Subject: Re: How to work with XML data using System Events?
  • From: pete boardman <email@hidden>
  • Date: Fri, 4 Nov 2005 14:14:13 +0000

On 4 Nov 2005, at 13:47, Matt Neuburg wrote:

Example (from you-know-where):

no, where?

tell application "System Profiler"
    set s to (XML text of document 1)
end tell
on findElementWithValue(e, v)
    tell application "System Events"
        repeat with i from 1 to (count XML elements of e)
            if value of XML element i of e is v then
                return i
            end if
        end repeat
    end tell
    error "not found"
end findElementWithValue
tell application "System Events"
    set x to make new XML data with data s
    set e to XML element 1 of XML element 1 of x

get XML element 1 of XML element 1 of «class id 1

--> "System Events got an error: Can't make XML element 1 of XML element 1 of «class id 1 into type reference."

but I take your point! Will spend another half hour on it.

thanks

Pete _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: How to work with XML data using System Events? (From: Matt Neuburg <email@hidden>)

  • Prev by Date: RE: making applescript wait until shell script finishes
  • Next by Date: Re: Specific Date-Time Formatting
  • Previous by thread: Re: How to work with XML data using System Events?
  • Next by thread: Re: How to work with XML data using System Events?
  • Index(es):
    • Date
    • Thread