It’s quite easy to center the selected item using GUI scripting.
I apologizes but you will see the french names reported by the script.
tell application "Mail" to activate
tell application "System Events" to tell process "Mail"
set frontmost to true
tell window "Nouveau message"
-- class of UI elements --> {static text, text field, button, static text, text field, button, static text, text field, button, static text, text field, button, static text, text field, scroll area, pop up button, static text, button, button, button, toolbar, group}
tell group 1
--class of UI elements --> {pop up button, pop up button, color well, color well, group, group, menu button, menu button}
-- class of UI elements of group 1 --> {checkbox, checkbox, checkbox, checkbox}
-- class of UI elements of group 2 --> {button, button, button}
tell group 2
-- description of buttons --> {"aligner à gauche", "centrer", "aligner à droite"}
click button 2 -- Center the selection
end tell
end tell
end tell
end tell
As you may see I disabled the instructions used to get infos about the UI elements.
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) vendredi 6 septembre 2019 16:13:16