Adobe Illustrator Changing Colors

It’s been nearly a year since I have been working on some mash up code to do all sorts of tasks in adobe illustrator.

I am successfully changing colors currently by :


set iL to count every path item
			set colorSwatches to swatchgroup "theColors"
			set allColors to get all swatches colorSwatches
			set swatchCount to count every item in allColors
			repeat with i from 1 to swatchCount
				set currentSwatch to item i of allColors
				set currentName to currentSwatch's name
				repeat with x from 1 to iL
					set myItem to path item x
					if myItem's selected then
                                              set myItem's fill color to (swatch currentName's color)
				        end if
				end repeat





I now need to add another condition in to check against. I need to make sure the selected item isn’t a Spot color or a certain named color.

It’s been so long since I have coded that I almost need to start from scratch, hoping someone will know the easy way to do this and jump start my reprogramming.