Re: trigger menu item in contextual menu
Re: trigger menu item in contextual menu
- Subject: Re: trigger menu item in contextual menu
- From: Alex Zavatone <email@hidden>
- Date: Tue, 03 Aug 2010 09:26:08 -0500
There is a great script that will allow you to do this. I'll send it as soon as I get into the office.
On Aug 3, 2010, at 9:22 AM, KOENIG Yvan wrote:
> 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
_______________________________________________
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