hi There,
Working on this code, i’m can’t seem to figure it out:
It returns {“XX, XX, XX, XX”} instead of {XX, XX, XX, XX}
when the " " are present InDesign can’t make a color
Can somebody tell me why and HOWTO remove them?
Thanks,
Steven
note: install http://www.latenightsw.com/freeware/XSLTTools/index.html
set theXML to "<?xml version="1.0"?>
<swatches>
<data value="00, 00, 100, 00" name="Color 1"/>
<data value="00, 100, 0, 0" name="Color 2"/>
</swatches>"
set valueItem to extract from XML theXML matching "swatches/data" expression {"@value"} as string
set nameItem to extract from XML theXML matching "swatches/data" expression {"@name"} as string
set anItem to text items of valueItem
set AppleScript's text item delimiters to ""
set theCounter to count of anItem
tell application "InDesign CS"
set theDoc to make document
set theDoc to document 1
tell theDoc
try
repeat with i from 1 to theCounter
set a to item i of valueItem as list
set b to item i of nameItem
set newColor to make color with properties {model:spot, space:CMYK, color value:a, name:b}
end repeat
on error number -2710 -- Can't make color
beep
--close theDoc saving no
end try
end tell
end tell