0

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)

1
  • @user3439894 I'm starting to suspect it's just a timing issue. If I put a delay of a second between show next and set selected slide ... things seem to be okay (though I have to test some more). Is there a way to tell AppleScript to wait until show next was successfully carried out?
    – 220284
    Feb 7 at 16:23
0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .