comobject internet.application

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
danjones
Posts: 2
Joined: 22 Nov 2015, 16:26

comobject internet.application

24 Nov 2015, 19:49

Hello folks. I'm new to the forum, beginner user with ahk. I'm hoping someone can lend a hand on a script I'm working with. I run windows 10, and use edge as my primary browser. of course, IE is installed, but I don't use it much. I have a script that doesn't want to run unless IE browser is actually opened. If I have it opened, then the script runs fine. I'm not sure what to do to get the script to run without IE having to be opened. Please let me know what other info you will need to help me out. Thanks. Here is a portion of the script, I think the issue might lie here, but I can provide the whole script if needed: (username and password removed for this example.)

Code: Select all

#SingleInstance force
DetectHiddenWindows, On

gosub,inicheck
Checked:

pwb := ComObjCreate("InternetExplorer.Application")
pwb.Navigate("http://127.0.0.1:8000/Kernel?function=AskAuthKey&Login="username "&Password="password "")
While pwb.ReadyState != 4
Sleep 10
Var1 := pwb.document.getElementsByTagName("body")[0].innertext
Sleep, 20
pwb.quit()
Last edited by tank on 06 Dec 2015, 12:09, edited 1 time in total.
Reason: Fixed code tags
User avatar
kczx3
Posts: 1640
Joined: 06 Oct 2015, 21:39

Re: comobject internet.application

25 Nov 2015, 07:53

The code you are using will only work with IE. Edge does not support or use the same model (I think, or something along those lines at least). You may want to add a line before your pwb.Navigate(...) as well.

Code: Select all

pwb.Visible := True
danjones
Posts: 2
Joined: 22 Nov 2015, 16:26

Re: comobject internet.application

06 Dec 2015, 00:11

this particular script uses an ".ini" file, as it controls other scripts. I have other scripts that do not use this .ini file, and they run just fine without the IE browser opened. It has something to do with the ini files.
User avatar
Blackholyman
Posts: 1293
Joined: 29 Sep 2013, 22:57
Location: Denmark
Contact:

Re: comobject internet.application

06 Dec 2015, 03:33

This part.

Code: Select all

pwb := ComObjCreate("InternetExplorer.Application")
pwb.Navigate("http://127.0.0.1:8000/Kernel?function=AskAuthKey&Login="username "&Password="password "")
While pwb.ReadyState != 4
Sleep 10
Var1 := pwb.document.getElementsByTagName("body")[0].innertext
Sleep, 20
pwb.quit()
opens a new IE window and navigates to url and asks for auth

The first line does one it creates an IE window and stores the COM in the pwb variable the code the uses this object to control and navigate the IE window

So this code not work without IE

But if your saying that you need to have an extra IE window open, I can't say!
Also check out:
Courses on AutoHotkey

My Autohotkey Blog
:dance:

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: ccqcl, DataLife, Google [Bot], Rohwedder and 177 guests