Traverse submenu

Asked by swathi

Hi,

I would like to traverse in a submenu using Sikuli.For e.g I want to click File->New. How do I do it.
click(find<Filemenuimage>.inside().click<Newimage>) does not always work.

Also I face issues with Key.DOWN and Key.RIGHT

Regards,
Swathi

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

I'm a Mac.

My experience with trying to find() pictures, that mainly contain text (true for menu entries), is: not stable (sometimes works, sometimes not).

So my strategy is to first look for a shortcut, that can be used with type(), either globally or restricted to the context of the app (a really amazing feature with OS X).

Second look is for stepping thru the menus:
switchApp("Safari")
type(Key.F2, KEY_CTRL)
type(Key.RIGHT)
type(Key.DOWN)
for i in range(6):
   type(Key.DOWN)
type(Key.ENTER)

works perfectly and brings me to the preferences.

The problem with stepping thru menus is, that depending on the situation some entries may be inactive and will be jumped over. You never know where you are.

In general I think that with the momentary design and implementation, Sikuli is not the first choice when automating by clicking menu entries is the focus.

With OS X e.g. using applescript and GUI scripting, you can ask a menu item about its name and its status (active/inactive). So you always know where you are and what should happen.

Can you help with this problem?

Provide an answer of your own, or ask swathi for more information if necessary.

To post a message you must log in.