Quark 6.5 Deleting Color specs Replacing with another color??

I have figured out how to change a color spec in Quark from spot to process, from one CMYK value to another, etc, AND I have figured out how to delete a color from the color spec list. Deleting one changes anything colored with that color to black.

Is there a way to specify what color you want to to change to when you delete (like when you manually delete a color from the color list that is being used)??

I have a script that will check to see if a color exists in your Quark document, and then change it to a different name if it does exist. The problem is, if that color name already exists, I want to basically merge the two together. Again, this is simple doing it manually but I can’t figure out how to make the script do it.

Any ideas??

set VariableGreen to {65535, 0, 65535, 0}

tell application "QuarkXPress"
	tell front document
		set ListOfColors to name of every color spec
		if "Variable Text" is in ListOfColors then
			if "Black Variable" is in ListOfColors then
				delete color spec "Black Variable" --and change anything colored "Black Variable" to "Variable Text" instead. This is the part I can't figure out
			end if
			repeat with x from 1 to the count of color spec
				set ColorCheck to name of color spec x as string
				if ColorCheck is "Variable Text" then
					set properties of color spec ColorCheck to {name:"Black Variable", color type:CMYK type, CMYK color value:VariableGreen, separation:false}
					exit repeat
				end if
			end repeat
			
		end if
	end tell
end tell

Model: Mac G5 OS 10.3.9
Operating System: Mac OS X (10.3.9)

Matt-Boy, I can’t help you out with this but you unknowingly provided me with 2 lines of code that I hadn’t had time to look at so thank you. Have a lazy color import lets you pick samples in photoshop to the forground colour then transfers to new swatch in quark.

tell application "Adobe Photoshop CS"
	set DocRef to the current document
	if (mode of DocRef is CMYK) then
		try
			set MyC to (cyan of foreground color) as integer
			set MyCyan to ((MyC) * 655.35)
			set MyM to (magenta of foreground color) as integer
			set MyMagenta to ((MyM) * 655.35)
			set MyY to (yellow of foreground color) as integer
			set MyYellow to ((MyY) * 655.35)
			set MyK to (black of foreground color) as integer
			set MyBlack to ((MyK) * 655.35)
		on error
			display dialog "You need to pick a CMYK colour from the image"
		end try
	end if
end tell
tell application "QuarkXPress"
	tell document 1
		set MyColorName to "C" & MyC & " " & "M" & MyM & " " & "Y" & MyY & " " & "K" & MyK
		set ListOfColors to name of every color spec
		if MyColorName is in ListOfColors then
			display dialog "You have allready imported this color!!"
		else
			make color spec at beginning with properties {name:MyColorName, CMYK color value:{MyCyan, MyMagenta, MyYellow, MyBlack}, separation:true}
		end if
	end tell
end tell