This is my code:
#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. #Include COM.ahk Login(userinput1,userinput2) { COM_Invoke(pwb, "Navigate", "javascript:document.getElementById('email').value='" userinput1 "';void(0)") Sleep, 100 COM_Invoke(pwb, "Navigate", "javascript:document.getElementById('password').value='" userinput2 "';void(0)") Sleep, 100 COM_Invoke(pwb, "Navigate", "javascript:document.getElementById('account_form').submit();") } InputBox, user1, Login, Email:,, 200, 125,,,,, Inputbox, user2, Login, Pass:,HIDE,200,125,,,,, Gui +LastFound COM_AtlaxWinInit() pwb:=COM_AtlAxGetControl(COM_AtlAxCreateContainer(WinExist(), 0, 0, 800, 400, "shell.explorer") ) COM_Invoke(pwb, "Navigate", "http://www.tumblr.com/dashboard") Gui, Show, x12 y162 h400 w800, Bot Login(user1,user2) return GuiClose: Exitapp
Now the thing is, when I run this it loads up the gui and browser fine, but then I get this error:
--------------------------- COM Error Notification --------------------------- Function Name: "Navigate" ERROR: The COM Object may not be a valid Dispatch Object! First ensure that COM Library has been initialized through COM_Init(). () Will Continue? --------------------------- Yes No ---------------------------
I've searched a bunch, and to be honest I'm stumped.
Can someone help me out?
On Another note, can anyone help with with the javascript to select the password field on this login page? I've been able to get the email field as well as the submit button but the password field has been throwing me off.
Thanks!