Problem with repeating loop (ID CC)

Hi,

I’m trying to duplicate every tint in a document so I can have normal swatch color in ID CC. I get an error in my repeat loop thought and I can’t figure it out.

tell application “Adobe InDesign CC”
set myDocument to active document
set myTints to every tint of myDocument
repeat with i from (count of myTints) to 1 by -1

	get properties of tint i of myDocument
	set theName to (name of base color of tint i of myDocument) & " " & ((tint value of tint i of myDocument) as string)
	set colorValue to (color value of tint i of myDocument)
	set myColor to make color with properties {model:process, space:CMYK, color value:colorValue, name:theName}
	
end repeat

end tell

Some background…
I have to convert some ID document to MS word. If I have tints from the black swatch, they come in as black 100%, not as their tint value. So with this script I’m trying to at least make the tint as normal swatch so I can then convert them to RGB. I’ll still have to manually replace the tints with their newly created swatch thought but at least the creation part will be done automatically. If you have a better way of doing this please share!

TIA
Jeff

OK, I got what I wanted with this script:

tell application “Adobe InDesign CC”
set myDocument to active document
set myTints to every tint of myDocument
repeat with i from (count of myTints) to 1 by -1

	get properties of tint i of myDocument
	set theName to (name of base color of tint i of myDocument) & " " & ((tint value of tint i of myDocument) as string)
	set colorValue to (color value of tint i of myDocument)
	set tintValue to (tint value of tint i of myDocument)
	tell myDocument
		set myColor to make color with properties {model:process, space:CMYK, color value:{0.0, 0.0, 0.0, tintValue}, name:theName}
	end tell
end repeat

end tell

Since the only Swatch that causes a problem when converting to RGB is the Black, I thought it was safe to do it that way.

Now I have to figure out how to delete the swatches that are applied with the tint and replacing them with the regular swatch…

Ok, that wasn’t complicated. Just add this line after the set myColor line.

delete tint i replacing with swatch theName