Issue with ID of a tag in HTML (COM)

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
AllUrBaseRBelong2Us
Posts: 35
Joined: 09 Nov 2015, 11:15

Issue with ID of a tag in HTML (COM)

25 Nov 2015, 22:50

Hey guys, here's the code:

Code: Select all

SetBatchLines, -1
#NoEnv

IELoad(wb)
{
		while wb.busy
			Sleep, 100
}
InputBox, YTurl, ,Enter the YouTube URL to get the corresponding MP3 file:



WB := ComObjCreate("InternetExplorer.Application")
WB.Navigate("www.youtube-mp3.org")						<-------Here's the link if you're interested in testing it
ieload(wb)
wb.visible:=true
wb.document.all.youtube-url.value:=YTurl						<-------Here's the line with the error "This line does not contain a recognized action"

Issues:
The name of the ID viz "youtube-url" is allegedly causing errors because of the hyphen in the name.

Any workaround or am I missing out on some crucial point?
Thanks in advance!
User avatar
Soft
Posts: 174
Joined: 07 Jan 2015, 13:18
Location: Seoul
Contact:

Re: Issue with ID of a tag in HTML (COM)

26 Nov 2015, 00:14

add ' ComObjError(false) ' at the top of your script
AutoHotkey & AutoHotkey_H v1.1.22.07
AllUrBaseRBelong2Us
Posts: 35
Joined: 09 Nov 2015, 11:15

Re: Issue with ID of a tag in HTML (COM)

26 Nov 2015, 00:20

Soft wrote:add ' ComObjError(false) ' at the top of your script
I get the same error :/
User avatar
Blackholyman
Posts: 1293
Joined: 29 Sep 2013, 22:57
Location: Denmark
Contact:

Re: Issue with ID of a tag in HTML (COM)

26 Nov 2015, 08:08

wb.document.all["youtube-url"].value

But better to use wb.document.getElementById("youtube-url").value as the all method is dispatched
Also check out:
Courses on AutoHotkey

My Autohotkey Blog
:dance:

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Kintaro-OEx, peter_ahk and 363 guests