• 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
Rép: How may I get/trigger some menu items in Pages
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Rép: How may I get/trigger some menu items in Pages


  • Subject: Rép: How may I get/trigger some menu items in Pages
  • From: Yvan KOENIG <email@hidden>
  • Date: Fri, 15 Sep 2006 08:56:11 +0200

Hello

Thanks to Chris Nebel, here is an enhanced version.
Setting the ruler units is now OK.


--[SCRIPT] set theApp to "Pages"

tell application theApp to set pp to path to it

tell application theApp -- it's easier than specifying the app's pathname

set lstrShowInspector to localized string "Show Inspector"
set lstrHideInspector to localized string "Hide Inspector"


set lstrSmoothPath to localized string "Smooth Path" from table "UndoStrings"
set lstrWrapStyle to localized string "Wrap Style" from table "UndoStrings"
set lstrWrapTreshold to localized string "Wrap Threshold" from table "UndoStrings"

set lstrNewInspector to localized string "New Inspector" -- localized unreachable
set lstrItemPreferences to localized string "Preferences…" -- localized unreachable
set lstrCentimeter to localized string "Centimeter" -- localized unreachable
end tell


tell application "Pages"
	set ruler units to picas
	if ruler units is not centimeters then set ruler units to centimeters
	set runits to ruler units
end tell

tell application theApp
activate
tell application "System Events" to tell process theApp to set ll to name of every menu item of menu 8 of menu bar 1
end tell


repeat with ii from 1 to count of ll
	if ll's item ii is in {lstrShowInspector, lstrHideInspector} then
		set lstrNewInspector to ll's item (ii + 1)
		exit repeat
	end if
end repeat


if ll contains lstrShowInspector then
display dialog "No Inspector is displaid" & return & "item " & ii & " is " & lstrNewInspector
else
display dialog "At least one Inspector is displaid" & return & "item " & ii & " is " & lstrNewInspector
end if
-- I stripped the reminder which doesn't change to fit the allowed message limit ;-))


--[/SCRIPT]

The remaining problem is: How may I trigger a contextual menu ?

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


References: 
 >Re: How may I get/trigger some menu items in Pages (From: Yvan KOENIG <email@hidden>)

  • Prev by Date: Re: Displaying the Restart Dialog
  • Next by Date: Re: Image Events problem
  • Previous by thread: Re: How may I get/trigger some menu items in Pages
  • Next by thread: Rép: How may I get/trigger some menu items in Pages
  • Index(es):
    • Date
    • Thread