如何使用applescript在powerpoint中更改组中所选形状的颜色?

时间:2015-07-13 17:20:37

标签: applescript powerpoint

当我将n个形状分组在一个组中,并从组中选择一个形状并更改颜色,但是该组中所有形状的颜色变化,如何克服这个插孔? ,我需要从该组中更改该特定形状的颜色

下面代码更改所有形状颜色

tell application "Microsoft PowerPoint"
    activate

    set theShapeRange to shape range of selection of active window
    set selected to child 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 {14, 235, 5}
            set back color of fill format of it to {14, 235, 5}
        end tell
    end repeat

end tell

1 个答案:

答案 0 :(得分:0)

我怀疑AppleScript无法做到这一点。

PowerPoint(2011)的selection属性将分组的形状作为单个对象返回,但没有关于在组内选择特定形状的信息。

child shape range的内容也指定了该组。