Keynote: change fill color of selected shape

any guide as to what I'm doing wrong?
I want to set the color of a selected existing shape to White, triggered by a shortcut.

tell application "Keynote"
activate
if not (exists document 1) then error number -128
tell the front document
	tell the current slide
		tell thisShape  
			set fill color of thisShape to {1, 1, 1}
		end tell
	end tell
end tell

end tell

thanks!

it seems it's "background fill type", but still no luck.
Reposting with edit:

tell application "Keynote"
	activate
	if not (exists document 1) then error number -128
	tell the front document
		tell the current slide
			tell thisShape  
				set background fill type of thisShape to {1, 1, 1}
			end tell
		end tell
	end tell
end tell

I'm not sure that the name thisShape is actually bound to anything in that snippet ...

I can see that the Keynote scripting interface exposes the current slide, but I don't think that it offers a reference to the current selection, though I may well be missing something.

If slide scripting is important, you may, alas, need to switch to PowerPoint ...

thanks.
It seems "background fill type" is Read Only:
source:

:disappointed:

might resort to automate clicking color picker coordinates...

Yes, this works great in Powerpoint:

tell application "Microsoft PowerPoint"
activate
set theShapeRange to shape range of selection of active window
set n to (count shapes of theShapeRange)
repeat with i from 1 to n
	tell shape i of theShapeRange
		set fore color of fill format of it to {0, 200, 255}
		set fore color of line format of it to {255, 0, 0}
	end tell
end repeat
end tell

might be faster to work in Powerpoint and convert final slide to Keynote
Thanks

1 Like