我正在使用 AppleScript 来驱动我正在为另一种语言的 PowerPoint 生成脚本所做的一些测试。基本上脚本所做的是重新加载特定的演示文稿,然后关闭除幻灯片 Pane 之外的所有 Pane ,这样我就可以获得正在生成的幻灯片的最大、最详细的 View 。
我已经完成大部分内容了,但不知道如何关闭窗口顶部的功能区。
如何使用 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
最佳答案
尝试:
activate application "Microsoft PowerPoint"
tell application "System Events"
tell process "Microsoft PowerPoint"
keystroke "r" using {command down, option down}
end tell
end tell
关于applescript - 如何使用 AppleScript 关闭 MS Office Ribbon?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23257979/