MS Office Ribbon使用AppleScript有多接近?

时间:2014-04-24 01:05:40

标签: applescript

我正在使用AppleScript来开展一些测试,我正在使用其他语言进行PowerPoint生成脚本。基本上脚本的作用是重新加载特定的演示文稿,然后关闭幻灯片窗格以外的所有窗格,这样我就可以获得我生成的幻灯片的最大,最详细的视图。

我大部分时间都在那里,但无法解决如何关闭窗口顶部的功能区。

如何使用AppleScript获取功能区的引用?

到目前为止,这是我的脚本:

tell application "Microsoft PowerPoint"
    if the name of the active window is "foobar.pptx" then
        close the active window
    end if
    open "foobar.pptx"

    set the bounds of the active window to {-1920, 22, 0, 1200}
    set the split horizontal of the active window to 0
    set the split vertical of the active window to 100
end tell

1 个答案:

答案 0 :(得分:2)

尝试:

activate application "Microsoft PowerPoint"
tell application "System Events"
    tell process "Microsoft PowerPoint"
        keystroke "r" using {command down, option down}
    end tell
end tell