1

Тема: AHK: ControlSend не работает с IE

Здравствуйте.

Столкнулся с проблемой ControlSend не посылает команду в IE 11. Скрипт выглядит так:


;Параметры окна через WinSpy
;Name - Internet Explorer
;ahk_class IEFrame
;ahk_exe iexplore.exe

SetTitleMatchMode, 2

sleep 1000
loop,
{
	ControlSend,, {Space}, Name - Internet Explorer
	Sleep 1000
}

Pause::Pause
return

Пробовал ставить все параметры, которые есть в WinSpy. При том WinActivate с параметром Name - Internet Explorer работает. Проверил ControlSend на блокноте - тоже работает.
Подскажите, в чем может быть проблема. Спасибо!

2 (изменено: g0ss, 2019-04-18 09:54:13)

Re: AHK: ControlSend не работает с IE

Может быть кто-нибудь знает как сделать прокрутку страницы, когда браузер работает на фоне?

UPD: нашел - pwb.Document.ParentWindow.scrollBy(0, 1000)

3

Re: AHK: ControlSend не работает с IE

g0ss


#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#SingleInstance force   ; игнор уже запущенного скрипта, переоткрытие

ie := ComObjCreate("InternetExplorer.Application")
ie.Visible := true
ie.Navigate("https://yandex.ru")
while ie.readystate <> 4
Sleep 500

ie.document.ParentWindow.scrollBy(0, 1000)

sleep 1000
ie.quit
ExitApp