Forum Discussion
JWhitesPro_1928
Dec 13, 2017Cirrostratus
Until I find a good answer I just created an AutoIT script that reads a file called c:\myfile.txt that contains each domain on a line. You then open the script and go to the smtp security profile,click the domain text box and place the mouse over the "Add" button and then press Control + V and the script will read the file line by line, type the text into the box, click the add button, then press Shift + TAB to bring focus back to the text box, wait half a second and then do it again for the next line. Script below for anyone who cares. It could be modified to automate other things in the GUI of this nature. (AutoIT).
include
include
HotKeySet("^v","ClipboardToKeystroke")
While 1
Sleep(50) ; If you forget this, your program takes up max CPU
WEnd
Func ClipboardToKeystroke()
HotKeySet("^v", "Dummy") ; This unregisters the key from this function, and sets it on a dummy function
While _IsPressed("11") Or _IsPressed("56") ; Wait until both the ctrl and the v key are unpressed
Sleep(50)
WEnd
$file = "c:\myfile.txt"
FileOpen($file,0)
For $i = 1 to _FileCountLines($file)
$line = FileReadLine($file,$i)
Send($line,1)
MouseClick("left")
Send("+{TAB}") ; Send Shift + tab to move back to textbox
Sleep(500)
Next
FileClose($file)
HotKeySet("^v", "ClipboardToKeystroke")
EndFunc
Func Dummy()
; Do nothing, this prevents the hotkey to calling the ClipboardToKeystroke function a lot when you hold the key down too long
EndFunc