Would anyone have an idea as to how to access the the control-click context menu popup using GUI scripting? In a previous thread some great info was provided by Bill Cheeseman for GUI scripting in general and the various actions available including AXRaise, AXPick, AXPress, AXShowMenu and a few others, as well as using modifier keys (see the thread titled "How to add keywords to photos in iPhoto?")
However, even armed with this info, I'm still unable to get access to the context menu popup. I was thinking of somehow telling AppleScript to perform a click "using {control down}" but can't get it to work.
Here's an excerpt to simulate a command-k:
keystroke "k" using {command down}
So I was thinking something like:
perform click using {control down} -- this doesn't work
or maybe
perform action "AXShowMenu" of <???>
and then accessing the resulting context menu popup like a regular menu, but I can't seem to find the correct incantation.
When accessing context menu popups through user interaction, the mouse only needs to hover over the object when pressing control-click, no selection is necessary. Is it possible to simulate hovering the mouse over a particular object prior to invoking the context menu so we get the right context menu?
If it helps, my underlying intent is to access the context menu popup for albums under the "Albums" grouping and then select the "Sort Albums" menu item.
Any ideas would be very welcome.
Best, Dalmazio
|