Combining scripts

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Jim Gregory
Posts: 4
Joined: 23 Mar 2020, 17:28

Combining scripts

23 Mar 2020, 18:08

I access an IP camera with Internet Explorer using three input parameters: IP address, ID, password. Thus far, I have been unable to do this with a single Autohotkey script. When line 1 executes, a window from the camera asks for ID and password. The camera program waits for this input and the script does not progress to Lines 2 and 3. When an ID and password are typed in manually, or entered by running a second script, camera operation proceeds normally. Is there a way to run the equivalent of lines 1,2, and 3 in a single script?
line 1 Run "C:\Program Files\Internet Explorer\iexplore.exe " ‘IP-address’
line 2 Send,’ID’{enter}
line 3 Send,’password’{enter}
I’m obviously new to Autohotkey and hope there is an elementary solution to this problem. All help much appreciated.
Jim Gregory
Posts: 4
Joined: 23 Mar 2020, 17:28

Re: Combining scripts

24 Mar 2020, 16:52

Update: The following script can access and run the IP camera but requires two keystrokes: first the script hot key and a second keystroke responding to the MsgBox. Removing the MsgBox lets the script open the camera log-in window but it does not enter the ID and PW. Does anyone see how to access and run the camera app with just one keystroke?
Run "C:\Program Files\Internet Explorer\iexplore.exe " ‘IP-address’
MsgBox,
Send,’ID’{enter}
Send,’PW’{enter}
User avatar
Delta Pythagorean
Posts: 627
Joined: 13 Feb 2017, 13:44
Location: Somewhere in the US
Contact:

Re: Combining scripts

24 Mar 2020, 17:57

Hello, Jim!

In response as to what you are wanting to happen, I suggest looking into these commands here: Sleep and Hotkeys.
If these do not work or do not suit your needs, the entire AutoHotkey documentation is readily available, if you cannot find what you're looking for, up at the top left of the docs there is Content, Index, and Search.
Using Index, you can search for a particular word or phrase and it will try its best to find what you're looking for.
If you are lost, you can reply to this thread and someone will get back with you as soon as possible.

Cheers, Delta.

[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat

Jim Gregory
Posts: 4
Joined: 23 Mar 2020, 17:28

Re: Combining scripts

25 Mar 2020, 15:19

Thank you for responding. I am trying to use AHK to run an application that requires logon credentials.
This line opens the application and its logon window.
RunWait "C:\Program Files\Internet Explorer\iexplore.exe " 10.0.0.111
The next lines do not send values to the open application window.
Send,admin{enter}
Send,123{enter}
Sleeping up to 10000 millisecs before the send lines does not help.
Invoking the script via hotkey does not help.
Inserting a MsgBox line before the Send lines helps but the MsgBox requires a response. I wish the script to work automatically without having to respond.

In 12/28/16 Post Tomasc reported a very similar problem, but no solution was offered.

I have searched the forum for help but am still lost.

:cry:
User avatar
Delta Pythagorean
Posts: 627
Joined: 13 Feb 2017, 13:44
Location: Somewhere in the US
Contact:

Re: Combining scripts

25 Mar 2020, 19:07

Hello again, Jim.

My recommendation is to use ControlClick to focus the fields and then use ControlSend to send the login information.
An example looks like so:

Code: Select all

; ControlClick, [Control-or-Pos, WinTitle, WinText, WhichButton, ClickCount, Options, ExcludeTitle, ExcludeText]
ControlClick, x45 y30, Login Infomation,, Left, 1

; ControlSend, [ Control, Keys, WinTitle, WinText, ExcludeTitle, ExcludeText]
ControlSend,, foobar, Login Infomation
If you have any further questions, again, I or someone else will be around to assist in any way we can!

Cheers, Delta.

[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat


Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: OrangeCat and 278 guests