tommytx 0 Posted September 21, 2010 < $hog = _IETagNameGetCollection ($oIE, "button") For $x In $hog Msgbox(0, "", $x.name) Next > This loop finds two buttons with names on the page. Button 1 and Button 2... I seem to be missing something, how can I capture the second button name as I have tried the following code... $y = $hog[0].name $z = $hog[1].name This is the variable I want.. I must be formatting it wrong... as the loop above displays what I am looking for, and I want to capture the second one in the variable $z but it does not work... what have I done wrong? When the for loop above runs it displays the name of the two buttons... perfectly... But I cannot seem to capture them. The links I am using throw an error. Share this post Link to post Share on other sites
seandisanti 6 Posted September 21, 2010 (edited) _IEFormElementGetObjByName()? Edited September 21, 2010 by cameronsdad Share this post Link to post Share on other sites
tommytx 0 Posted September 22, 2010 Thanks for the suggestion, but the name changes on every load so I do not have the name, I have to wait for to load to find out what it is.. However I find this works but is cumbersome. $hog = _IETagNameGetCollection ($oIE, "button") For $x In $hog $dat = $x.name Next msgbox(0,"",$dat) So what happens is when the loop finished $dat end up with the last variable in the iteration and that works fine, but only because the last one [0], [1] of the two items is the one I want so its still in $dat and I can use it ok, but what I really need is the format to grab it without the loop.. its something like $dat = $hog[1].name or $hog.name[1] but they don't seem to work. Can anyone see my error? Share this post Link to post Share on other sites
DaleHohm 65 Posted September 22, 2010 $oButton1 = _IETagNameGetCollection ($oIE, "button", 0) $oButton2 = _IETagNameGetCollection ($oIE, "button", 1) ConsoleWrite("Button1: " & $oButton1.name & @CRLF) ConsoleWrite("Button2: " & $oButton2.name & @CRLF) Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curlMSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object modelAutomate input type=file (Related)Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better?IE.au3 issues with Vista - WorkaroundsSciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Share this post Link to post Share on other sites
tommytx 0 Posted September 22, 2010 that is fantastic Dale... thank you... Share this post Link to post Share on other sites