Search code examples
applescriptpowerpoint

Setting PowerPoint font color with Apple Script


I'm trying to use Apple script to set the font color of all selected PowerPoint shapes. I used something similar to this to set fill and line color, but I haven't been able to get it to work for font color.

tell application "Microsoft PowerPoint"
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 font color of text range of it to {99, 99, 99}
    end tell
end repeat

end tell


Solution

  • Based on the guidance provided by Mockman in a comment above, this seems to work.

    tell application "Microsoft PowerPoint"
        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 font color of font of text range of text frame of it to {99, 99, 99}
            end tell
        end repeat
    end tell