Hello
I am trying to script Pages 1.0.2.
As a french guy, I work with the french app. It's boring because the "localized string" function is unable to return the localized version for every used strings. Some are not stored in the Localizable.strings file (some are in UndoStrings.strings others are elsewhere).
So, I wrote this script using some tricks.
Now, my problem is: how may I get the names of the four items in the popupmenu "Unités de la règle" then force it to Centimeters/Centimètres.
tell application theApp set lstr to localized string "Show Inspector" set lstr to localized string "Hide Inspector" set lstr to localized string "New Inspector" -- localized unavailable set lstr to localized string "Preferences…" -- localized unavailable set lstr to localized string "Centimeter" -- localized unavailable set lstr to localized string "Smooth Path" -- localized unavailable (stored in UndoStrings.strings) end tell
tell application theApp set pp to localized string "%@ Preferences" if pp starts with "%@ " then set p to (text 4 thru end of pp) else set p to (text 1 thru -4 of pp) end if
activate tell application "System Events" tell process theApp click menu item (p & "…") of menu 2 of menu bar 1 set _ to get name of every window repeat with i from 1 to count of _ if _'s item i contains p then set wPrefs to _'s item i exit repeat end if end repeat
tell window wPrefs -- fenêtre Préférences get properties of pop up button 2 click pop up button 2 (* Unités de la règle *)
-- how may I grab the names of the four menu items -- I want to set it to centimeters/centimètres
end tell -- fenêtre Préférences end tell -- process theApp end tell -- application System Events end tell -- application theApp
Thanks in advance
Yvan KOENIG |