Partial web automation - keyboard shortcuts

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
foo-barbie
Posts: 3
Joined: 22 Oct 2019, 10:24

Partial web automation - keyboard shortcuts

22 Oct 2019, 10:29

I am looking for a way to partially automate a website based on where you are on a page, similar to "IfWinActive" command in AHK.

For example, if I am in page 1 and click F1, it does A, if I am in page 2 and click F1, it does B.

Is this possible in AHK?
gregster
Posts: 9029
Joined: 30 Sep 2013, 06:48

Re: Partial web automation - keyboard shortcuts

22 Oct 2019, 10:41

Yes, via IE COM interface, Chrome.ahk oder Selenium webdriver - but it isn't necessarily beginner level stuff.
If you know some javascript - that would help.

Well, if you only want to check for a specific active tab and send a key, you could probably work instead with window titles and commands again. That would be easier... but you don't give enough details. Please elaborate!
Getfree
Posts: 231
Joined: 12 Oct 2014, 18:00

Re: Partial web automation - keyboard shortcuts

22 Oct 2019, 14:04

There are myriads of shortcut managers that do this on Chrome and other browsers. Just google "shortcut manager for <browser_name>".

If you want a recommendation, use this one: AutoControl Shortcut Manager
It can redefine Chrome's native shortcuts (like F1 in your case).

Otherwise, just search for one in the web store of your favorite browser. There's no need for coding a custom solution unless you want to do really advanced stuff.
foo-barbie
Posts: 3
Joined: 22 Oct 2019, 10:24

Re: Partial web automation - keyboard shortcuts

23 Oct 2019, 04:35

@gregster

I cannot match based on window title, because it does not change when I am navigating that specific website.

I need some solution where I can match based on website URL or some other page element, e.g. "H1", e.g.:
- If "foo.bar/mainpage" is active, then F1 clicks on a button to post stuff.
- If "foo.bar/optionspage" is active, then F1 unchecks three checkboxes and chooses a specific option form a dropdown.
johnqflorida
Posts: 5
Joined: 22 Oct 2019, 09:02

Re: Partial web automation - keyboard shortcuts

23 Oct 2019, 20:38

A non-AHK answer, is to look at Selenium, which includes Selenium IDE, a record and playback tool where you can start simple-ish, and take it as far as you want beyond the IDE if you were so inclined. It can wait for, click, check, read anything, including page loads, whether page elements exist or not including XPath, DOM, or CSS identifiable elements.

Like AHK, it's got a large base of people who love it, and a lot of Selenium users naturally use AHK in conjunction with it..

Also with the IDE (firefox only), the browser add-in responds to user input, so you could get creative, using AHK to right click and use some Selenium features without specifically creating a Selenium script. Or, go crazy, it's got a full programming framework too. But the IDE is a start.
barbudo2005
Posts: 30
Joined: 03 Dec 2019, 20:39

Re: Partial web automation - keyboard shortcuts

07 Jul 2020, 18:50

Gerfree:

Is AutoControl Shortcut Manager really sure?

Install a Native-Component.exe file with two files :

One of the them is :AutoCtrl_2020.6.29.0.exe



https www.virustotal.com /gui/file/706c7a6f2ba412b6245d2a488b8ea7691ed31da41e3f3fe80d43e17ad1a4c260/detection Broken Link for safety
Getfree
Posts: 231
Joined: 12 Oct 2014, 18:00

Re: Partial web automation - keyboard shortcuts

08 Jul 2020, 00:33

barbudo2005 wrote:
07 Jul 2020, 18:50
Gerfree:

Is AutoControl Shortcut Manager really sure?

Install a Native-Component.exe file with two files :

One of the them is :AutoCtrl_2020.6.29.0.exe



https www.virustotal.com /gui/file/706c7a6f2ba412b6245d2a488b8ea7691ed31da41e3f3fe80d43e17ad1a4c260/detection Broken Link for safety
You mean if it's "safe" to use?
That virustotal page says 2 out of 72 engines detected the file, that's as low as it gets for any program that does anything useful. I've been using it for about a year or more without any trouble. Plus, having some experience myself with Chrome extension development in the past, I know that the Web Store review process is not easy to pass, all extensions are being monitored regularly for policy and privacy violations.
barbudo2005
Posts: 30
Joined: 03 Dec 2019, 20:39

Re: Partial web automation - keyboard shortcuts

08 Jul 2020, 12:34

Thank you for your fast response.

If you see the relations tab it connect to that IP:


IP Detections Autonomous System Country

81.169.202.3 8/ 92 6724 DE

Why if is offline extension?

In the behavior tab:

Registry Keys Opened
\Registry\Machine\System\CurrentControlSet\Control\Session Manager
\REGISTRY\MACHINE\Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings
\REGISTRY\USER\S-1-5-21-3616907901-860437140-2684471051-1001\Control Panel\Desktop
\Registry\Machine\System\CurrentControlSet\Control\Nls\CustomLocale
\Registry\Machine\System\CurrentControlSet\Control\Nls\ExtendedLocale
\Registry\Machine\Software\Microsoft\Windows NT\CurrentVersion\GRE_Initialize
\REGISTRY\MACHINE\SOFTWARE\Microsoft\OLE
\REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Services\crypt32
\REGISTRY\MACHINE
\REGISTRY\USER\S-1-5-21-3616907901-860437140-2684471051-1001
\Registry\Machine\System\CurrentControlSet\Control\Nls\Sorting\Versions
\Registry\MACHINE\System\CurrentControlSet\Control\Session Manager
\REGISTRY\USER\S-1-5-21-3616907901-860437140-2684471051-1001\Control Panel\Desktop\MuiCached
\REGISTRY\MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings



Also:

8 engines detected this IP address

81.169.202.3 (81.169.128.0/17)
AS 6724 ( Strato AG )

Date resolved
Domain
2020-03-23
h2344885.stratoserver.net
Communicating Files
Scanned Detections Type Name
2020-07-06
50
/ 73 Win32 EXE SkinDialog_Demo
2020-07-07
43
/ 73 Win32 EXE 99ec8edf8515e65c1a347fdd20be9b15.virus
2020-07-07
44
/ 72 Win32 EXE b07d655e40c900e3d1c6aaab0e0dd2ee.virus
2020-07-07
44
/ 72 Win32 EXE cecd1661c56a5aa488b7ece811706f22.virus
2020-07-07
44
/ 73 Win32 EXE b31d5d989781effb291bb3ae3d23fee1.virus
2020-07-05
41


44 engines detected this file
048ea821563e9af63d178b9313a31b2244529293c94bf758bb4f514bdfdc9d93
b31d5d989781effb291bb3ae3d23fee1.virus


/ 72 Win32 EXE 6f9c927c90839ddf94b0eaa5452d3d14.virus
2020-07-03
43
/ 72 Win32 EXE SkinDialog_Demo
2020-07-06
49
/ 72 Win32 EXE SkinDialog_Demo
2020-07-01
42
/ 72 Win32 EXE SkinDialog_Demo
2020-07-02
35
/ 73 Win32 EXE MPEGPlayer


The extension is so so good but Virus Total say strange things.


What do you think?
Getfree
Posts: 231
Joined: 12 Oct 2014, 18:00

Re: Partial web automation - keyboard shortcuts

08 Jul 2020, 16:36

barbudo2005 wrote:
08 Jul 2020, 12:34
Thank you for your fast response.

If you see the relations tab it connect to that IP:


IP Detections Autonomous System Country

81.169.202.3 8/ 92 6724 DE

Why if is offline extension?
I've seen those bogus IP traffic reports before.
Take for example this analisis of some older version of AutoHotkey.exe
https://www.virustotal.com/gui/file/de2690282ceadbfd098d54c6dec9f8e810b4435816dbea56d9c99d3aad2c3ec8/behavior/VirusTotal%20Cuckoofork

It also say that the program generated IP traffic. Which is, of course, impossible because AHK does not open network connections unless it runs a script that does so.
At the very least, a program must load a network-related DLL such as Wininet.dll or other in order to communicate externally, and I don't see any such DLLs in that VT report you gave.

About the registry access, all that stuff is normal for any Win32 application. Compare it with this other report of an AHK executable.
https://www.virustotal.com/gui/file/0dad23c0e6c295c32e90479116dc58663cc8818735e8b8e2193e85bd9a68b428/behavior/Tencent%20HABO

The executable is tested bare-bones, without running any AHK script, and yet the report says that it accessed a long list of registry keys. That's just typical Win32 initialization done automatically by the DLLs being loaded by the program.

If you are still unsure, contact the developers of the application, let them know about the network traffic and see what they tell you.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: filipemb, haomingchen1998, mikeyww, Oblomov228, RussF, sanmaodo and 266 guests