Jump to content

How to activate menus in Mozilla Firefox?


Buffo
 Share

Recommended Posts

Hello

Today appears a new problem: I want to run menu entries in firefox. The AutoIt InfoWindow only shows me two different controls in the whole firefox window: menu and taskbars are MozillaWindowClass1 and the browserwindow is MozillaWindowClass16.

I tried WinMenuSelectItem, ControlSend and ControlClick. WinMenuSelect item only works with standard-controls, right? For ControlSend and ControlClick, I don't have the classes.

At this time I activate the Firefox-window and send keys:

Opt("WinTitleMatchMode", 2)
WinActivate("Firefox")
Send("^s"); -> SaveAs

This temporary solution isn't my favourite. Anyone a tip for a more elegant solution? Best I would use ControlSend or ControlClick ;-)

Regards,

Buffo

Link to comment
Share on other sites

Very oddly enough, I wasn't able to make this approach work:

Opt('WinTitleMatchMode', 4)
ControlSend('ClassName=MozillaWindowClass', '', 'MozillaWindowClass1', '^s')

even though WinGetHandle('ClassName=MozillaWindowClass') returns a handle. However this example (which uses a literal part of the title) works:

ControlSend('AutoIt Forums', '', 'MozillaWindowClass1', '^s')
Link to comment
Share on other sites

Very oddly enough, I wasn't able to make this approach work:

ControlSend('AutoIt Forums', '', 'MozillaWindowClass1', '^s')
I am so stupid B)

This is what I tried, too. But I swapped two letters. I used "MozillaWindowCalss1".

Now it works :o

Regards,

Buffo

Link to comment
Share on other sites

Very oddly enough, I wasn't able to make this approach work:

Opt('WinTitleMatchMode', 4)
ControlSend('ClassName=MozillaWindowClass', '', 'MozillaWindowClass1', '^s')

even though WinGetHandle('ClassName=MozillaWindowClass') returns a handle.

For anyone who's interested, this was because a handle to a window that wasn't the browser was being returned. This means that if you want to find a Firefox browser window without knowing its title, you'll need to search by class (which will return a few windows) and then look for a window with a certain amount of controls or something. Fiddly but doable.

Why Mozilla decide not to give their software windows meaningful class names in the first place is beyond me though.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...