Create a Keynote presentation at screen resolution

Mar 18, '09 07:30:00AM

Contributed by: harald

When creating a new Keynote presentation, you are limited to choose from a list of predefined sizes like 800x600 or 1024x768 in most cases. If you use the following AppleScript, however, you can to set the size of the presentation to the actual screen resolution (of the main screen):

tell application "Keynote" 

  -- get resolution of main display 
  set displayInfo to words of (do shell script "/usr/sbin/system_profiler SPDisplaysDataType | grep 'Main Display:' -B 4 | grep 'Resolution:'") 
  set themeWidth to ({item 2} of displayInfo) as number 
  set themeHeight to ({item 4} of displayInfo) as number

  -- chose a theme for a new presentation 
  set chosenTheme to (choose from list (name of appThemes as list)) as Unicode text 

  -- create a new slideshow based on the computer's resolution 
  set thisSlideshow to make new slideshow with data {theme:chosenTheme, slideSize:{themeWidth, themeHeight}} 

end tell
You can download the latest version of this script by using this link.

[robg adds: This works as described -- just make sure Keynote doesn't have the Theme Chooser window on the screen, so that AppleScript can display its own version of the theme chooser.]

Comments (4)


Mac OS X Hints
http://hints.macworld.com/article.php?story=2009031616092928