• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How may I get/trigger some menu items in Pages
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How may I get/trigger some menu items in Pages


  • Subject: How may I get/trigger some menu items in Pages
  • From: Yvan KOENIG <email@hidden>
  • Date: Thu, 14 Sep 2006 11:57:35 +0200

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
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: How may I get/trigger some menu items in Pages
      • From: Emmanuel <email@hidden>
  • Prev by Date: Re: Mount AFP volume and if/or cases
  • Next by Date: Rép: How may I get/trigger some menu items in Pages
  • Previous by thread: iTunes artwork
  • Next by thread: Re: How may I get/trigger some menu items in Pages
  • Index(es):
    • Date
    • Thread