I'm using ahk tool for a while and this forum helped me a lot! Thanks in advance for all your effort to help other users.
I'm facing some problem related to IE and COM, and my goal is to achieve a background automating using COM object instead of using the common ahk commands.
I'm copying info from an Excel tab and inserting those in a IE page, but almost every time the process ends (when I "click" on a Submit button), a Dialog Box pops up showing a message that I need to filter and an OK button for me to press in order to continue the whole process.
I'm intending to read the message that appears like this:
Code: Select all
if(InStr(pwb.Document.body.innerHTML, "Message that appears in the Popup"))
I've tried to Silent the handle like this:
Code: Select all
handleIE.silent := true
Code: Select all
#Persistent
SetTimer, ClosePopup, 50
return
ClosePopup:
WinClose, Title of the Dialog Box, Some Text inside the Dialog Box
return
Code: Select all
handle.document.parentWindow.frames["main"].document.getElementsByClassName("alert-box alert")[0].close()
When I do the same process using Google Chrome and the Dialog Box appears, an option is showed as "Prevent this page from creating additional dialogs" and this solved the problem. How can I do this using IE? I'm tied up to IE because of the COMM object. I know it's possible to use Selenium libraries and JavaScript to perform this on Chrome, but the learning curve would be slower.
Any thoughts?
Thanks in advance!