Firefox automation

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
usser
Posts: 146
Joined: 22 Oct 2014, 13:03

Firefox automation

14 Jul 2018, 18:43

Hello!

How can I make a keybind work only when cursor is inside a web form?

thanks!
Shade4Real
Posts: 16
Joined: 16 Jun 2018, 00:54

Re: Firefox automation

14 Jul 2018, 21:06

Code: Select all

IfWinExist (firefox window title)
{
---Script
}
You should take a look at IfWinExist
usser
Posts: 146
Joined: 22 Oct 2014, 13:03

Re: Firefox automation

15 Jul 2018, 11:36

Shade4Real wrote:

Code: Select all

IfWinExist (firefox window title)
{
---Script
}
You should take a look at IfWinExist
Are you some kind of joke? Are you a noob? Did you fully understand what I asked?
gregster
Posts: 9068
Joined: 30 Sep 2013, 06:48

Re: Firefox automation

15 Jul 2018, 11:56

To be frank, your question does not give awfully much to work with... especially with Firefox, checking the window title (with a context-sensitive hotkey) might not be such a bad idea, if you want to use the hotkey in a specific web form/website (of course, the hotkey would also be active in Firefox's address field, for example). That wouldn't specifically help with "web forms", but would generally work when a (specific or any, depending on the context you define) Firefox window is active - but you didn't say much about your actual use case. Hence, it would be nice if you could scale back your aggressiveness a bit, if someone wants to help you. (Are you really surprised that a vague question gets a vague answer?)

You probably know that Firefox has no COM interface like Internet Explorer. But there is the possibility to use the (third-party) Selenium webdriver (which would need to be installed) to interact with Firefox - I think Joe Glines made some (video) tutorials about using it. With IE and Chrome, there would be other options. But the question would still be what exactly constitutes a web form? I guess, there is a whole number of possible elements to check for, in the source code of a website (especially if you also consider javascript elements). And I am not sure, if it would be easy/possible to really limit the hotkey to these elements. A more precise request would probably help others to help you...

Ps.: Perhaps you could also use accviewer and the acc library to get the right infos about a website, but I would rather try to use IE or Chrome for your (supposed) use case.

Edited
usser
Posts: 146
Joined: 22 Oct 2014, 13:03

Re: Firefox automation

15 Jul 2018, 12:39

Oh that gets too complicated.
By 'web forms' I mean any web form in any website really. My problem is that some key bindings work in cases when I just want them to type the normal text.
I tried to distinguish them, by making them work when the cursor is IBeam, but this is not a good method either.

Is there anything else that can be done?

For example, I have the left/right arrow to focus the left/right tab, but when the cursor is inside a web form, I obviously want it to just move to the left/right character!
loidokaar
Posts: 10
Joined: 30 Jan 2019, 10:36

Re: Firefox automation

10 Mar 2024, 04:29

There should be an easy way to make fields and buttons of the web page available to AHK. If FF would update its title bar (window title) upon entry into/onto a field/control and add [[%controlname%]] to the window title, then AHK would know if we have successfully tabbed into the field we need to navigate to. Heck, maybe it can tell the content of the field also? Then we can use Send, %sendthis% or whatever. There is a FF addon https://github.com/tpamula/webextension-window-titler/issues that seems to do the title updating, but I have no knowledge of FF addon programming. Bing refuses to code FF addon for me. Maybe somebody is able to modify this addon to put field/control name to the window title?

Thanks,
Kaido

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], UncouthGoose and 131 guests