0

This is for either AppleScript or JXA:

I'd like to automate a task in Keynote, which involves Keynote's Shape Styles: if any existing shape has a certain RGB-value, I'd like to assign a specific Shape Style to it. So first question would be: is there a Shape Style class? And can RGB values be read out? (I've seen a similar script for Powerpoint in Visualbasic).

Fish
  • 37
  • 1
  • 1
  • 3

1 Answers1

0

No such class. These are the properties of a shape, which are the styles of the shape, some of which you can alter, some of which are read-only:

{class:shape, opacity:100, parent:slide 1 of document id "54ACE2F5-F2CF-41B8-B5B0-0FDC27778D96", reflection showing:false, background fill type:advanced image fill, position:{609, 157}, object text:"", width:100, rotation:0, reflection value:0, height:100, locked:false}

Which is to say: shape, opacity, parent, reflection showing, background fill type, position, object text, width, rotation, reflection value, height and locked.

A basic operation in AppleScript to find this type of information is to do (for example):

tell application "Keynote"
    properties of shape 1 of slide 1 of document 1
end tell

But, as you can see, the only thing close to fill color is background fill type, which is read-only. You can assign a text item to the shape and get/set it's text color, but that's it, it seems. It's a woeful limitation.

CRGreen
  • 3,406
  • 1
  • 14
  • 24