DispatchEvent example and help

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
g835
Posts: 1
Joined: 14 Feb 2017, 12:57

DispatchEvent example and help

14 Feb 2017, 14:48

I've been trying to automate BMC Remedy and have had some difficulty with some of the fields not updating unless I physically mouse click the field before sending text to the field or use a SendInput to get it to recognize that I sent text to it. I was trying to find more details on DispatchEvent but couldn't find much on the forum with an AHK example. The OuterHTML and ID is listed below for one item I'm trying to change. I believe I need to use a TextEvent to make it process updates I'm using but am unsure how to get it to work. I've also tried mouse events.

<textarea class="text sr bHighlight bHighlight" id="arid_WIN_3_1000000000" style="left: 117px; top: 0px; width: 175px; height: 21px;" rows="1" cols="20" wrap="off" arencryptdataatrest="0" arautoctt="400" arautocak="0" maxlen="100"></textarea>

Tried the following:

Code: Select all

WB.document.getELementById("arid_WIN_3_1000000000").value := "000000000000000"
TextEvent := WB.document.createEvent("TextEvent")
TextEvent.initTextEvent("TextInput",True,True, "", "test", 9, "en-US")
WB.document.getElementByID("arid_WIN_3_1000000000").dispatchEvent(TextEvent)

An example from another forum on here I tried using:

Code: Select all

MouseDownEvent := WB.document.createEvent("MouseEvent")
MouseDownEvent.initMouseEvent("mousedown",true,false, _, _, _, _, _, _, _, _, _, _, _, _)

MouseUpEvent := WB.document.createEvent("MouseEvent")
MouseUpEvent.initMouseEvent("mouseup",true,false, _, _, _, _, _, _, _, _, _, _, _, _)

WB.document.getElementByID("arid_WIN_3_1000000000").dispatchEvent(MouseDownEvent)
WB.document.getElementByID("arid_WIN_3_1000000000").dispatchEvent(MouseUpEvent)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Lamron750, septrinus and 243 guests