문제

I'm using AppleScript to drive some testing I'm doing for PowerPoint generation scripts in another language. Basically what the script does is reload a particular presentation, then close all the panes other than the slide pane so I can get the biggest, most detailed view of the slide I'm generating.

I'm most of the way there, but can't work out how to close the Ribbon at the top of the window.

How do I get a reference to the Ribbon using AppleScript?

This is my script so far:

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
도움이 되었습니까?

해결책

Try:

activate application "Microsoft PowerPoint"
tell application "System Events"
    tell process "Microsoft PowerPoint"
        keystroke "r" using {command down, option down}
    end tell
end tell
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top