kakarotsaiyan Posted September 10, 2018 Posted September 10, 2018 I'm trying to learn autoit since a month, i wanted to send text to IE when its not active using controlsend- it works but when a text cursor containing app or window is active or in the foreground, the text is entered over there like i open chrome and it starts to enter the text in chrome. I guess i'm doing something wrong, if anyone can point it out it would be helpful. expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> #RequireAdmin GUICreate("TEST", 270, 100, 850, 300, Default,$WS_EX_TOPMOST) GUISetState(@SW_SHOW) HotKeySet ("{numpaddot}", "MyExit") GUICtrlCreateLabel("Send", 5, 12) $key1 = GUICtrlCreateInput(IniRead("configTEST.ini", "Config", "$key1",""), 45, 10, 80) GUICtrlCreateLabel("➽ [ Numpad Dot ] TO EXIT", 4, 65) Local $startbutton = GUICtrlCreateButton("Start", 165, 8, 60) Opt("SendKeyDelay", 75) While 1 $msg = GUIGetMsg() Select Case $msg = $startbutton $send1 = GUICtrlRead($key1) Sleep(2000) While 1 ControlSend("HospitalfilesADMIN - Internet Explorer", "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", $send1) Sleep(2000) WEnd EndSelect WEnd Func MyExit() IniWrite("configTEST.ini","Config","$key1",GUICtrlRead($key1)) Exit EndFunc
Zedna Posted September 10, 2018 Posted September 10, 2018 (edited) I strongly recommend to look at and use IE UDF, details in the HelpFile in UDF section/IE Management. #include <IE.au3> Local $oIE = _IE_Introduction("basic") https://www.autoitscript.com/autoit3/docs/libfunctions/_IE_Introduction.htm Edited September 10, 2018 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now