Applescript Indesign - Working with color swatches and tints

Problem… (and apologies for being a nooooob at this)

I have hundreds of files that use a tint of Pantone 304 C and I need to change the tint to plain old black 5%. The files have one swatch for “Pantone 304 C” and a tint swatch under that that is “Pantone 304 C (20%)”.

I can change the swatch of Pantone 304 C to 5% black, but the 20% tint swatch still exists, and all objects that were once 20% blue are now 20% of 5% black - which is to say, 1% black.

(Yes, I know I could just make the new color 25% black and then the “25% black 20%” would equal 5% black but that’s just sloppy.)

I tried to merge swatches but I can’t get the syntax. So far I have this which creates the new swatch but does nothing else for me:

my main()
	tell application "Adobe InDesign CS6"
		tell active document
			delete unused swatches
			set properties of swatch "PANTONE 304 C" to {model:process, space:CMYK, color value:{0, 0, 0, 5}, name:"5% black", tint value:"100%"}
		end tell
	end tell

I’ve done extensive online searches but I’m coming up empty. I’m thinking that I need a new step to delete a tint swatch and replace with “5% black” but I can’t find the right code to delete a tint swatch, only a color.

Many thanks for any input.

Model: IMac
AppleScript: 2.6.1
Browser: Firefox 36.0
Operating System: Mac OS X (10.8)

Hi. As you suspected, merge is the command you want. Tint swatch isn’t in the app’s dictionary, and, since they’re sort of like an alias, you can’t change the parent without changing all associated references.

tell application "Adobe InDesign CS3"'s document 1
	delete unused swatches
	merge (make color with properties {model:process, space:CMYK, color value:{0, 0, 0, 5}, name:"5% black", tint value:"100%"}) with tint "PANTONE 304 C 20%"
end tell

Thank you SO much. This works like a charm. I was thinking in too many steps. You are WONDERFUL!

Hi!
I am trying to replace a RGB swatch with a CMYK color. I have a BrighBlueRGB (0,110,255) that I need to be in pdfs for web and for print I have to replace it with a PrintBlueCMYK (100,80,0,0). The First color is defined as a swatch color in all Indesign files.

I tried to replace via

set PrintBlueCMYK to "100,80,0,0"

set properties of swatch  "BrightBlueRGB" to {model:process, space:CMYK, color value:PrintBlueCMYK}

but all I get is
Can’t set properties of swatch “BlueRGB” to {model:process, space:CMYK, color value:“100,57,0,0”}.

Any ideea?
thanks a lot
Dan