"Dynamic" ComObj("InternetExplorer.Application") Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
Posts: 55
Joined: 18 Sep 2018, 22:17

"Dynamic" ComObj("InternetExplorer.Application")

18 Sep 2018, 23:22

Good morning everyone, I have a question about the "ComObj" (specifically internet explorer).
Is it possible to enter properties as variables?
····························································· For example:
f(a, b, c, d) {
Return a.getElementBy%b%(c).%d%
····························································· So I could do something like;
Msgbox % f(a,"ID","Example1","innerText") ;; show InnerText Example1 (ID)
Msgbox % f(a,"TagName","Example2","value") ;; show Value of Example2 (TagName)
Sorry my bad English. Thanks in advance.
User avatar
Posts: 3879
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: "Dynamic" ComObj("InternetExplorer.Application")  Topic is solved

19 Sep 2018, 01:08

Code: Select all

f(a, b, c, d) {
Return a["getElementBy" . b](c)[d]
In order to access objects dynamically you have to use []
Also you might find that getElementByTagName doesn't exist.
There is only getElementsByTagName.
getElementById will work normally though - but getElementsById might fail.
Recommends AHK Studio
Posts: 55
Joined: 18 Sep 2018, 22:17

Re: "Dynamic" ComObj("InternetExplorer.Application")

19 Sep 2018, 01:29

It is the first time that I post in the forum; and the response was very quick! 0.0
Thank you very much!!! ^^

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], hatross, magusneo, newbieforever, teadrinker, toni and 79 guests