Jump to content
Sign in to follow this  

Need to copy link from IE object to Input

Recommended Posts


Hi all.

Here is a sample, IE object with link and Input.

I need to get link text in Input, when clicking link. But i have no any ideas...

#include <EditConstants.au3>

#include <GUIConstantsEx.au3>

#include <WindowsConstants.au3>

#include <IE.au3>

Opt("GUIOnEventMode", 1)


$Form = GUICreate("Form1", 320, 285, 193, 115)

GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")

$Input = GUICtrlCreateInput("", 16, 248, 249, 21)


$oIE = _IECreateEmbedded()

$Output = GUICtrlCreateObj($oIE, 10,10, 300, 200)

$sHTML='<a href="http://">Google</a>'

_IENavigate($oIE, "about:blank")

_IEDocWriteHTML($oIE, $sHTML)

;Here $text should get data "Google" somehow, but only after click.


While 1



Func Form1Close()



Edited by Axel82

Share this post

Link to post
Share on other sites

No, I have in view of another.

There is a form with Button and Input. I clicked Button, and function "Buttonclick" read text of the button and put it in Input.



I need the same, but for a link.

By pressing the link, its text should appear in Input.


Edited by Axel82

Share this post

Link to post
Share on other sites

You'll need to use ObjEvent. You'll have trouble however because AutoIt does not handle events synchronously and seeing that the link causes the page to navigate, the link will no longer be valid by the time you try to access its properties in AutoIt.

You could potentially parse through all of the links on the page and note the link text after the initial load and then you could know the link text based on the link that triggers the onclick event because you already knew it rather than trying to read it after activation.


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe 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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.