One of the valuable aspects of the scripting support in Keynote, is AppleScript’s unique ability to manipulate, with a single script statement, the properties of slide objects that are placed throughout the document. For example, you can set the playback settings for every audio clip in a presentation with this script:
Set Global Playback Method for Audio Clips
01
tellapplication "Keynote"
02
activate
03
if not (existsdocument 1) then errornumber -128
04
set theplaybackMethodsto {"normal", "loop", "loop back and forth"}
05
setthisValueto ¬
06
choose from listplaybackMethodswith prompt ¬
07
"Set the playback method of every audio clip to:"
08
ifthisValueisfalsethen errornumber -128
09
tell the frontdocument
10
ifthisValueis {"normal"} then
11
setrepetition methodof ¬
12
everyaudio clipof everyslidetonone
13
else ifthisValueis {"loop"} then
14
setrepetition methodof ¬
15
everyaudio clipof everyslidetoloop
16
else
17
setrepetition methodof ¬
18
everyaudio clipof everyslidetoloop back and forth
19
end if
20
end tell
21
end tell
Or set the volume of all audio clips to the same setting with this script:
Set Global Volume Setting for Audio Clips
01
tellapplication "Keynote"
02
activate
03
if not (existsdocument 1) then errornumber -128
04
tell the frontdocument
05
repeat
06
display dialog "Enter a volume (from 0 to 100) to apply to all audio clips in this document:" default answer "100"
Other properties for movies that can be set globally include: locked, position, opacity, width, reflection showing, reflection value, and rotation.
Other properties for audio clips that can be set globally include: locked, and position.
You can even create a script that sets multiple properties for every movie, audio clip, image, shape, line, table, chart, etc., as with this script that sets multiple movie properties globally:
Mention of third-party websites and products is for informational purposes only and constitutes neither an endorsement nor a recommendation. MACOSXAUTOMATION.COM assumes no responsibility with regard to the selection, performance or use of information or products found at third-party websites. MACOSXAUTOMATION.COM provides this only as a convenience to our users. MACOSXAUTOMATION.COM has not tested the information found on these sites and makes no representations regarding its accuracy or reliability. There are risks inherent in the use of any information or products found on the Internet, and MACOSXAUTOMATION.COM assumes no responsibility in this regard. Please understand that a third-party site is independent from MACOSXAUTOMATION.COM and that MACOSXAUTOMATION.COM has no control over the content on that website. Please contact the vendor for additional information.