Skip to content

Instantly share code, notes, and snippets.

@derickfay
Created April 15, 2015 20:06
Show Gist options
  • Save derickfay/266d784577be460e3b68 to your computer and use it in GitHub Desktop.
Save derickfay/266d784577be460e3b68 to your computer and use it in GitHub Desktop.
Change Keynote theme and preserve image dimensions
set themeName to "Black"
tell application "Keynote"
set theSlides to slides of document 1
set theImages to {}
repeat with s in theSlides
set theImages to theImages & (images of s)
end repeat
set theDimensions to {}
repeat with i in theImages
set theDimensions to theDimensions & {{height of i, width of i, position of i}}
end repeat
set the document theme of the front document to theme themeName
set n to 1
repeat with d in theDimensions
tell item n of theImages
set height to item 1 of d
set width to item 2 of d
set position to item 3 of d
end tell
set n to n + 1
end repeat
end tell
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment