Question

Unfortunately, Keynote does not allow (as far as I know) to have presenter notes displayed when used in window mode. I'm trying to work around this by using Apple Script. More precisely, I generate a PDF document where on page n I have the presenter notes for slide n. I then open up my Keynote presentation in Window mode and the Skim PDF viewer. I use the following Apple Script to simultaneously advance the slides and the PDF

tell application "Keynote"
        activate
        show next
        set selectedSlide to slide number of current slide of front document
end tell
tell application "Skim"
    tell document 1
        go to page selectedSlide
    end tell
end tell

What puzzles me is that Skim is always one slide behind, so it displays page n-1 instead of n. This is (although I don't understand why) not too much trouble (as I could simply add one to the slide variable), but another more serious problem arises. Some of my slides have embedded movies which need a click to be played. The PDF document should remain on the same page, since only the movie is played, but the slide number does not increase. Nonetheless the PDF moves one page forward. Does anyone understand what's the problem here? (I'm using Keynote 10.3.9 and Skim 1.6 on macOS 10.15.6)

Was it helpful?

Solution

So it turn's out it is simply a timing issue adding delay does the trick:

tell application "Keynote"
        activate
        show next
        delay 0.1
        set selectedSlide to slide number of current slide of front document
end tell
tell application "Skim"
    tell document 1
        go to page selectedSlide
    end tell
end tell
Licensed under: CC-BY-SA with attribution
Not affiliated with apple.stackexchange
scroll top