Thank you Nigel. You gave useful infos.
Here is where I am.
(*
-- code dropped because it doesn't apply when the app is used in French.
Apple forgot to insert the file: "Keynote.app:Contents:Resources:fr.lproj:MainMenu.strings". They put a MainMenu.nib file.
Happily, there is a clone available as :
"Keynote.app:Contents:Resources:fr_CA.lproj:MainMenu.strings"
On my copy I duplicated the file so now the code works.
Maybe the file is available in versions newer than 9.1
Same odd omission in Pages and Numbers
As the numbering of menu items doesn't change since several years, I choose to trigger the menu items by their index.
tell application "Keynote"
set exportTo_loc to localized string "1543.title" from table "MainMenu" --> "Exporter vers"
end tell
*)
set indexFile to 3 -- index of menu "File" ("Fichier")
set indexExportTo to 14 -- index of menu item "Export To" ("Exporter vers")
set indexMovie to 3 -- index of menu item "Movie…" ("Vidéo…")
tell application id "com.apple.systemevents" to tell process "Keynote"
set frontmost to true
tell menu bar 1
-- get name of menu bar items --> {"Apple", "Keynote", "Fichier", "Édition", "Insérer", "Diapositive", "Format", "Disposition", "Présentation", "Lecture", "Partager", "Fenêtre", "Aide"}
-- get name of menu bar item indexFile --> "Fichier"
tell menu bar item indexFile to tell menu 1
-- get name of menu items --> {"Nouveau", "Créer à partir de la liste de thèmes…", "Ouvrir…", "Ouvrir un document récent", missing value, "Fermer", "Tout fermer", "Enregistrer", "Enregistrer sous…", "Dupliquer", "Renommer…", "Déplacer vers…", "Revenir à", "Exporter vers", missing value, "Réduire la taille du fichier…", "Avancé", missing value, "Définir un mot de passe…", missing value, "Modifier le thème…", "Enregistrer le thème…", missing value, "Imprimer…"}
-- get name of menu item indexExportTo --> "Exporter vers"
tell menu item indexExportTo to tell menu 1
-- get name of menu items --> {"PDF…", "PowerPoint…", "Vidéo…", "GIF animé…", "Images…", "HTML…", "Keynote ’09…"}
-- get name of menu item indexMovie --> "Vidéo…"
click menu item indexMovie
end tell -- menu item indexMovie
end tell -- menu bar item indexFile
end tell -- menu bar 1
-- class of UI elements
tell (first window whose subrole is "AXStandardWindow") -- EDITED
class of UI elements --> {radio group, checkbox, static text, scroll area, scroll area, scroll area, button, button, button, menu button, toolbar, image, static text, sheet}
tell sheet 1
-- class of UI elements --> {static text, list, static text, pop up button, static text, text field, static text, static text, text field, static text, static text, static text, text field, static text, text field, radio button, radio button, static text, pop up button, static text, button, button, button}
-- help of text fields --> {"Saisissez le nombre de secondes d’attente entre chaque diapositive.", "Saisissez le nombre de secondes d’attente entre chaque composition.", missing value, missing value} -- ADDED
set value of text field 1 to "10" -- must be a string -- ADDED
set value of text field 2 to "8" -- must be a string -- ADDED
-- help of pop up button 1 --> "Choisissez le mode de lecture de la vidéo."
-- help of pop up button 2 --> "Choisissez une taille pour la vidéo."
tell pop up button 2
its value --> "1024 x 768"
click it
repeat 50 times
if exists menu 1 then exit repeat
delay 0.2
end repeat
tell menu 1
-- class of UI elements --> {menu item, menu item, menu item, menu item}
-- name of menu items --> {"1024 x 768", "720p", "1080p", "Personnaliser…"}
click menu item -1 -- Custom
end tell
end tell
set checkBoxAvailable to (class of UI elements) contains checkbox --> {static text, list, static text, pop up button, static text, text field, static text, static text, text field, static text, static text, static text, text field, static text, text field, radio button, radio button, static text, pop up button, text field, static text, text field, static text, static text, checkbox, radio button, radio button, radio button, button, button, button}
-- help of text field -2 --> "Saisissez la largeur voulue pour la vidéo."
-- help of text field -1 --> "Saisissez la hauteur voulue pour la vidéo."
-- value of text field -2 --> "1024"
-- value of text field -1 --> "768"
set value of text field -2 to "1920" -- must be a string
set value of text field -1 to "1080" -- must be a string
-- name of radio button -3 --> "Apple ProRes 422"
-- name of radio button -2 --> "H.264"
-- name of radio button -1 --> "Apple ProRes 4444"
click radio button -1
if checkBoxAvailable then
-- name of checkbox 1 --> "Exporter avec des arrière-plans transparents"
value of checkbox 1 --> 1
-- set value of checkbox 1 to 1 -- enable it to check the box
-- set value of checkbox 1 to 0 -- enable it to uncheck the box
end if
end tell -- sheet 1
end tell
end tell -- System Events
As is, the script selects the Custom… format
then it define the width (1920) and the height (1080) of the window
and select the compression Apple ProRes 4444.
It lets the checkbox linked to transparency as is but it contain the instructions required to edit the setting.
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) mercredi 5 février 2020 16:58:08