Keynote Scripting and Automation

I don't think this breaks the Terms of Use. If it does, moderators please delete this. 🙂

As some of you may know, I've experimented with writing plugins to extend Keynote's capabilities in the past. These plugins included a rough AppleScript plugin for Keynote 1, before Apple released rudimentary AppleScript support in Keynote 2. I've been dragging my feet on writing a new AppleScript plugin for Keynote 2, but with the recent activity in Jeff Ferrell, "XML Slide Generation Possibilities?", 10:35am Jun 27, 2005 CDT about automating the replacement of text and images, I can see that many people would like to be able to come up with custom workflows to automate the creation and modification of Keynote presentations. So, I've decided to dedicate some time to write a new AppleScript plugin for Keynote 2 along with Automator actions to make it easy for people to use. My questions to anyone interested are:

  • If you are an AppleScript coder, what classes/properties/commands would you like to see?
  • If you are an Automator user, what actions would you like to see?
  • How would you feel if the AppleScript + Automator package was released as shareware? Would $10 to $15 be a reasonable price range?


These questions aren't just hypothetical, the work's already been started!

For AppleScript experts, you can download this sdef file to see the classes and commands that have already been implemented (in the Keynote Additions suite).

For Automator users, here's a list of the actions I've thought of so far:

Getting Items


  • Find Keynote Items (slideshows, slides, visuals)
  • Filter Keynote Items (slideshows, slides, visuals)
  • Get Specified Keynote Slides (by exact selection, index range, or index)
  • Get Keynote Visuals


Working with Slides


  • New Keynote Slide
  • Move Keynote Slides (by absolute or relative position)
  • Modify Keynote Slide Title (content, visibility)
  • Modify Keynote Slide Body (bullets, visibility)
  • Replace Keynote Slide Text (scope by key, class or pattern)


Working with Visuals


  • New Keynote Visual
  • Modify Keynote Visual (height, width, x position, y position, angle, horizontally flipped, vertically flipped, opacity, locked)


(Currently supported visuals are image, line, shape, title and body)

My intention is to release this by the end of this month or early next month. This will be followed by a second plugin dealing with iMovie/iDVD export, but I'll cover that in another thread later. I'd greatly appreciate any feedback (good or bad) on the posted questions, and anything else about this project.

Thanks in advance!

Posted on Jul 8, 2005 11:16 PM

Reply
58 replies

Jan 4, 2006 10:09 PM in response to King Chung Huang

I've posted the latest version of the plugin with an installer to simplify installation for everyone. The sample scripts from September are also on the page. I'll add more based on requests.

http://wiredflux.com/software/keynote/

Some of the notable changes from the last publicly posted version in September are:

- reorganization of the Keynote Additions suite into multiple suites:
- Keynote Basics: contains the application, slideshow and slide classes.
- Keynote Presentation: contains the presentation controller class and commands for controlling a fullscreen presentation (not functional yet).
- Keynote Themes and Masters: contains the theme template, theme and master slide classes. Everything's functional except for applying a theme to a presentation.
- Keynote Visuals: contains classes representing most of the elements of a slide.
- Keynote Exchange: will contain the import/export commands.

- simplified typing for shapes
- added theme and master support
- documentation

Jan 6, 2006 3:03 PM in response to King Chung Huang

The plugin has been updated with a functional Keynote Presentation suite. The slideshow controller (accessible from the application class) can currently provide the following attributes:

- whether Keynote is playing a fullscreen presentation (boolean)
- the current slide (slide, r/o)
- the current slide index (number)
- the number of slides in this slideshow (number, r/o)
- whether the current slide has any hyperlinks (boolean, r/o)
- whether the soundtrack is playing (boolean)
- whether the mouse cursor is visible (boolean)

Attributes like soundtrack playing and mouse cursor visible are not read-only, so you can use them to toggle the soundtrack and mouse cursor, respectively. The first attribute (playing a presentation) is meant to be settable too, but that is not implemented yet.

There's also one new command, freeze slideshow. It freezes the slideshow to black (like hitting the 'b' key) or with the image of the current slide.

I'm looking into a few more attributes and commands for this suite, then I'm moving on to tackle import/export in the Keynote Exchange suite.

http://wiredflux.com/software/keynote/

Jan 10, 2006 3:38 PM in response to King Chung Huang

The Scripting Plugin has been updated to version 2.1a3. This new pre-release version adds a basic export command to the Keynote Exchange suite. The dictionary for the export command is:

export slideshow : the slideshow to export
as Flash/HTML/PDF/PowerPoint/QuickTime/Still Images : the type to export as
to Unicode text : the location or base file name to export to
[ from slide slide] : the slide to start exporting from
[ to slide slide] : the slide to end exporting at
[ with options item] : the export options

For example, the following script statements export a slideshow as a PowerPoint presentation.

tell application "Keynote"
set ss to front slideshow
export ss as PowerPoint to "/Example.ppt"
end tell

Known Issues:
- exporting as QuickTime will cause Keynote to crash
- exporting as HTML is not supported yet
- export options, including specifying slide ranges, are not supported yet

Download link: Keynote Scripting Plugin 2.1a3

Jan 10, 2006 6:43 PM in response to King Chung Huang

The AppleScript plugin has been updated with support
for editing the text of shapes, and creation of new
visuals/drawables. Two new example scripts are
available to demonstrate this.

iPhotoAlbumToSlides.scpt
Prompts the user to select an iPhoto album, then
creates a slide for every image in the album.
http://commons.ucalgary.ca/~king/projects/keynoteplugins/scripting/examples/iPho toAlbumToSlides.scpt.zip

The updated plugin is at the same place as before:
http://commons.ucalgary.ca/~king/projects/keynoteplugins/scripting/plugins/


I'm working to modify this to work with iView MediaPro instead of iPhoto. First cut looks promising.

I installed the plugins. Are they needed for the iPhotoAlbumToSlides script to run? I don't know AS well enough to say, but I don't see how the plugins would be activated. But I have no idea what plugins are.

Any comments? I've put your name and links in my script as a credit.

I'm glad I found this script, because I not a clue how to work with Keynote. I'm doing this because I like the look ahead feature of Keynote and wanted to try it out.

Thanks for your work King.

Mac OS X (10.4.3)

Jan 10, 2006 9:41 PM in response to MtnBiker

I converted King's iPhoto to Keynote script to iView MediaPro to Keynote.

Here: http://keeptherubbersidedown.com/toShare/IVMP2Keynote.applescript

Watch the soft returns--some funky characters are showing up, I don't know how to post a script. Suggestions welcome. Maybe MacScripter or the iView site.

Thanks King.

I'll try to get this working for catalogs too.

Mac OS X (10.4.3)

Jan 11, 2006 12:50 AM in response to MtnBiker

Hi everybody,

I have created a forum elsewhere which may be of some benefit when it comes to sharing scripts and such.

There is a forum for developers, and elsewhere on the site will be forums for sharing/developing themes and templates

You can attach files to each thread that is started, but as yet only guests can see them (I think. I may be wrong on that)

If you wouldn't mind, this thread is getting a bit long and it might be easier to start a new one for each version of the scripting plugin that is released. I am sure the moderators won't have a problem with smaller, easier to read/use threads on these topics on the Apple forums.

Jan 27, 2006 2:02 PM in response to King Chung Huang

i've been working on a touch screen kiosk presentation and am defintiely intersted in automating and changing some things in keynote. for instance, is there anyway to restart the presentation after a period of inactivity?

also, adding some type of feedback sound when a hyperlink is touched/clicked would be nice too.

and yes, i would be willing to pay a shareware fee for either of those two.

Mar 3, 2006 11:15 AM in response to King Chung Huang

Hi,

can this plugin be used in Keynote 3 as well ?

If not, will there be a plugin for Keynote 3 ?

It would be great if you could add to your website http://wiredflux.com/software/keynote/

- for which version of Keynote the plugins are
- where they can be found after installation (to find out if installation was successful + to uninstall)


Thanks + best regards

Jan

Mac OS X (10.4.5)

Mac OS X (10.4.5)

Mar 11, 2006 12:53 AM in response to King Chung Huang

Hi King Chung Huang,

I've posted a question somewhere else on this forum and someone suggested that I contact you. I'm keen on rendering my GL world via Keynote and from reading your posts, you obviously know Keynote very well.

If you get a moment, I'm wondering if you could have a look at my posts at: http://discussions.apple.com/thread.jspa?threadID=397040&tstart=0

Cheers,
-C

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Keynote Scripting and Automation

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.