2014-04-24 24 views
2

我使用AppleScript驱动一些测试,我正在为其他语言的PowerPoint生成脚本进行测试。基本上,脚本所做的是重新加载特定的演示文稿,然后关闭幻灯片窗格以外的所有窗格,以便我可以获得我生成的幻灯片的最大最详细的视图。如何使用AppleScript关闭MS Office功能区?

我是那里的大部分,但不能解决如何关闭窗口顶部的功能区。

如何使用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 

回答

2

尝试:

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

这是卓有成效的,谢谢! – scanny