Change colors of individual lines in a Numbers cell

Hi:

I’m trying to write an AppleScript that will apply a different color to alternating lines within a cell of a Numbers table.

The cell has a number of lines in it, each separated by an option-return character.

The goal is to make the first line red, the second line blue, the third line red, the fourth line blue, etc.

This can be done manually using the Text Inspector and Text Color controls in the Inspector sidebar. But I’d like to use an AppleScript to automate it.

The following script, for example, when run after selecting text in a cell, uses System Events to change the color of all the text in the cell to blueberry:

activate application "Numbers"

tell application "System Events"
	tell application process "Numbers"
		tell window 1
			tell radio group of toolbar 1
				if value of radio button 1 = {{0}} then
					click radio button 1
				end if
			end tell
			click color well 1 of scroll area 3
			click button 5 of toolbar 1
			click radio button 33 of radio group 1 of splitter group 1
			click button 1
		end tell
	end tell
end tell

(Backticks for code posting added by NG. See the Markdown Reference here).

I’ve tried many things using parts of the script above to try to select the individual lines in a cell and apply a color to them, all to no avail.

Can anyone help me with this?

Thanks in advance.
mm