• 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
trigger menu item in contextual menu
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

trigger menu item in contextual menu


  • Subject: trigger menu item in contextual menu
  • From: KOENIG Yvan <email@hidden>
  • Date: Tue, 3 Aug 2010 16:22:11 +0200

Hello

I'm trying to help an user which want to apply the "Categorize by column" feature in Numbers.
There is no other track than GUI scripting.
Alas, I am able to open the contextual menu containing the menu item but find no way to reach the menu item itself.


--{code}

property the_column : 4

on run
	tell application "Numbers" to tell document 1
		set dName to name
		tell sheet 1
			set sname to name
			tell table 1
				set tname to name
				set selection range to column the_column
			end tell -- table
		end tell -- sheet
	end tell -- Numbers
	set avant to current date
	my categorize_column("Numbers", dName, sname, tname, the_column)

	tell application "System Events"
		activate
		display dialog "done in " & ((current date) - avant) & " seconds"
	end tell
end run

--=====

on categorize_column(the_app, d_Name, s_Name, t_Name, c_num)
tell application the_app to activate
tell application "System Events" to tell (first application process whose title is the_app)
tell first group of UI element 1 of UI element 1 of UI element 1 of scroll area 2 of splitter group 1 of last splitter group of splitter group 1 of window d_Name
(*
<AXApplication: “Numbers”>
<AXWindow: “bof.numbers”>
<AXSplitGroup>
<AXSplitGroup>
<AXSplitGroup>
<AXScrollArea>
<AXLayoutArea>
<AXMenuButton>
*)
click menu button c_num
(*
Now, need to trigger menu item 11 of menu 1
but don't find the way to do it !
<AXMenu>
<AXMenuItem: “Catégoriser selon cette colonne”>
*)
end tell -- first group of
tell window d_Name
properties of every sheet
end tell
--keystroke "k" using {command down, option down, shift down, control down}
end tell -- System Events
end categorize_column


--{code}

Help that some one know the trick to use.

Yvan KOENIG (VALLAURIS, France) mardi 3 août 2010 16:21:48



_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: trigger menu item in contextual menu
      • From: Alex Zavatone <email@hidden>
  • Prev by Date: Re: List oddity
  • Next by Date: Re: trigger menu item in contextual menu
  • Previous by thread: Re: Show differences in two apple scripts.
  • Next by thread: Re: trigger menu item in contextual menu
  • Index(es):
    • Date
    • Thread