I have tried more experimenting. Here's the script ...
on run do shell script "drutil list -xml" set response to the result -- text in xml format log response -- So you can see what you are doing tell application "System Events" set xmlData to (make new XML data with data response) --> «class xmld» = XML data -- count XML elements of xmlData --> 1 XML elements of xmlData --> list item 1 of the result --> «class xmle», no elements, no attributes end tell log the result end run
The logged response is ...
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <!DOCTYPE [ <!ELEMENT deviceList (device)*> <!ELEMENT device (vendor, product, firmware, interconnect, support)> <!ATTLIST device index CDATA #IMPLIED> <!ELEMENT vendor EMPTY> <!ATTLIST vendor name CDATA #REQUIRED> <!ELEMENT product EMPTY> <!ATTLIST product name CDATA #REQUIRED> <!ELEMENT firmware EMPTY> <!ATTLIST firmware revision CDATA #REQUIRED> <!ELEMENT interconnect EMPTY> <!ATTLIST interconnect name CDATA #REQUIRED> <!ELEMENT support EMPTY> <!ATTLIST support level (appleShipping|appleSupported|vendorSupported|unSupported|notSupported) #REQUIRED> ]>
<deviceList> <device name="PIONEER DVD-RW DVR-K06" index="1"> <vendor name="PIONEER"/> <product name="DVD-RW DVR-K06"/> <firmware revision="Q614"/> <interconnect name="ATAPI"/> <support level="appleShipping"/> </device> <device name="PIONEER DVD-RW DVR-110D" index="2"> <vendor name="PIONEER"/> <product name="DVD-RW DVR-110D"/> <firmware revision="1.17"/> <interconnect name="FireWire"/> <support level="appleShipping"/> </device> </deviceList>
It looks as if there is an xml element named "deviceList", but, there isn't. The only xml element I can get has no value, no name and no id. It is simply not possible to read any data from "xmlData".
Perhaps someone with more experience with xml sees something that I don't. I am at a dead-end with this particular 'drutil' command.
|