How can I fix sending keys problem after activating ie browser?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
my-lord
Posts: 45
Joined: 01 Apr 2018, 15:12

How can I fix sending keys problem after activating ie browser?

23 Apr 2018, 05:50

Hello guys.I have a ComObject internet explorer.I want to show existing browser windows and send keys and close this window.I write following code but it did not work.It opened ie window but it didn't send keys.

Code: Select all

WinActivate,ahk_class IEFrame
ControlFocus,ahk_class IEFrame
Sleep 50
Send, !n
Sleep 50
Send {tab}
Sleep 50
Send {Enter}
WinClose,ahk_class IEFrame
Return
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: How can I fix sending keys problem after activating ie browser?

23 Apr 2018, 06:36

- Try this:

Code: Select all

#IfWinActive, ahk_class IEFrame ;internet explorer
$!n:: ;internet explorer - focus notification bar
ControlFocus, Internet Explorer_Server1, A
SendInput, !n
return
#IfWinActive
- I've found this issue most annoying. In normal use, if the notification bar appears, and you press alt+n, it focuses it, however, if there is another notification bar underneath, and you press alt+n again, it doesn't get focused. My script fixes this.
- However, I would like to replace the use of SendInput with ControlSend, but I haven't been able to get it to work. Cheers.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
my-lord
Posts: 45
Joined: 01 Apr 2018, 15:12

Re: How can I fix sending keys problem after activating ie browser?

23 Apr 2018, 07:31

jeeswg wrote:- Try this:

Code: Select all

#IfWinActive, ahk_class IEFrame ;internet explorer
$!n:: ;internet explorer - focus notification bar
ControlFocus, Internet Explorer_Server1, A
SendInput, !n
return
#IfWinActive
- I've found this issue most annoying. In normal use, if the notification bar appears, and you press alt+n, it focuses it, however, if there is another notification bar underneath, and you press alt+n again, it doesn't get focused. My script fixes this.
- However, I would like to replace the use of SendInput with ControlSend, but I haven't been able to get it to work. Cheers.
Thanks, I tried it but it doesn't focus internet explorer window and sendkeys doesn't work on internet explorer window.How can İ fix that?
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: How can I fix sending keys problem after activating ie browser?

23 Apr 2018, 07:47

- Use WinActivate, ahk_class IEFrame.
- SendKeys!? Use SendInput, or ControlSend if you can get it to work. Send keys in order to achieve what?
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
my-lord
Posts: 45
Joined: 01 Apr 2018, 15:12

Re: How can I fix sending keys problem after activating ie browser?

23 Apr 2018, 07:59

jeeswg wrote:- Use WinActivate, ahk_class IEFrame.
- SendKeys!? Use SendInput, or ControlSend if you can get it to work. Send keys in order to achieve what?
I want to send keys for focusing internet explorer "save or open" pop up.I tried ControlSend following way but it didn't work

Code: Select all

WinActivate,ahk_class IEFrame
Sleep 250
ControlSend, ,!n,Internet Explorer
Sleep 250
ControlSend, ,{tab},Internet Explorer
Sleep 250
ControlSend, ,{Enter},Internet Explorer
return
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: How can I fix sending keys problem after activating ie browser?

23 Apr 2018, 11:16

Yes, it sounds like you're trying to interact with the (white/orange) notification bar, and I gave you my best script so far, and I said that I couldn't get ControlSend to work, only SendInput.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Exies and 123 guests