Please can anyone help!
I have a simple XML file that I would like to extract the values from using applescript. But I can’t figure out how to get the results I need.
What I need is a list of records with the name, Coverage and CoveragePerc of each Ink.
I can get the names of the inks using the script below but I can’t figure out how to get the other 2 properties of each ink
My script looks like this at the moment:
set theFile to (choose file)
set ColourInfo to getXMLJobInfo(theFile)
on getXMLJobInfo(theFile as string)
tell application "System Events"
tell XML file theFile -- alias as string
tell XML element "InkCoverage"
tell XML element "Inks"
set CompleteColourInfo to {} as list
set NoOfColours to count of every XML element
repeat with ii from 1 to NoOfColours
set ThisColourInfo to {InkName:"", InkCoverage_Percent:0, InkCoverage_mm:0}
tell XML attribute of XML element ii
set InkName of ThisColourInfo to (value)
-- somehow get Coverage Value of this ink
-- somehow get CoveragePerc Value of this ink
end tell
set the end of CompleteColourInfo to ThisColourInfo
end repeat
end tell
end tell
end tell
end tell
return CompleteColourInfo
end getXMLJobInfo
and the XML file’s text (saved to my desktop) is
“<?xml version="1.0" encoding="UTF-8"?>
”
Hope this is clear
Thanks