How to Automatically Stop a Keynote Presentation

Yesterday, we looked at how Power Manager can be used to automatically open and start a Keynote presentation. Today, we will create an event to stop the presentation at a specific time each day. Paired together these two events can be used to start and stop Keynote presentations without needing to touch the Mac.

There is more than one way to automate the stopping of a Keynote presentation. If you use Power Manager to shut down your Mac, you can leave Keynote running and let the shut down process tidy up for you.

For our event, we will not quit Keynote, but instead ask Keynote to stop the slideshow. We will do this using a small AppleScript snippet embedded in the event.

Creating an Event to Automatically Stop Keynote

  1. Launch System Preferences and select Power Manager.
  2. Click Add… to create a new event.
    Click Add… to create a new event in Power Manager
  3. Choose the template Run a script daily.
    Choose the Schedule Assistant's template Run a script daily
  4. Where Power Manager asks for the Script to run, copy and paste in the following AppleScript:
    #!/usr/bin/osascript
    
    tell application "Keynote"
        stop slideshow
    end tell
        
    Power Manager supports a range of scripting languages
    Copy and Paste in the Keynote AppleScript Snippet
  5. Continue to the next step.
  6. Select the time and days to stop your presentation.
    Set up when to stop your Keynote presentation
  7. Continue through the remaining steps until your event is created.
    Your AppleScript is ready and scheduled to stop Keynote

The event is now ready and scheduled. The event works by running the AppleScript snippet when triggered each day. The AppleScript embedded within the event asks Keynote to stop the current slideshow.

Power Manager performs a little magic and performs the AppleScript as the active, frontmost, user. This allows Power Manager to perform AppleScripts that include interaction with other applications and with the graphical interface.

This event is self-contained. The AppleScript is included in the event. You can freely share your Keynote controlling events with others via e-mail, without needing to rely on other files.

This article was posted in , , and and tagged , , , , and .

Published by Graham Miln on