Allochthonous Posted February 10, 2010 Posted February 10, 2010 I need to be able to find a string in a window ("http") and position my cursor on top of it so that i can send Crtl-A to capture an entire URL. Can this be done? PK
PsaltyDS Posted February 10, 2010 Posted February 10, 2010 (edited) Read up on the _IE* functions of the IE.au3 UDF. Once you can identify the DOM element that contains what you want, get the text with something simple like: $sText = $oElement.innerText Or maybe: $sURL = $oLink.href This demo opens the AutoIt home page and gets the URL from the "graphics and wallpapers" link in the text: #include <IE.au3> $sURL = "http://www.autoitscript.com" $oIE = _IECreate($sURL) $colLinks = _IELinkGetCollection($oIE) For $oLink In $colLinks If StringInStr($oLink.innerText, "graphics and wallpapers") Then $sHref = $oLink.href MsgBox(64, "Result", "The 'graphics and wallpapers' link points to: " & $sHref) ExitLoop EndIf Next Edit: Added demo. Edited February 10, 2010 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Allochthonous Posted February 11, 2010 Author Posted February 11, 2010 Actually, the string i am looking for and want to center on (so i can capture it) is not in an IE window. It is in an email like application. The string is an URL and starts with "http." I want to capture it and launch it automatically in IE. PK
PsaltyDS Posted February 11, 2010 Posted February 11, 2010 Did you examine it with the AutoIt Window Info Tool (AU3Info.exe) to see if the control was recognized? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Allochthonous Posted February 11, 2010 Author Posted February 11, 2010 Yeah, but I will be honest, I am fairly new to AutoIt and don't really know what I am looking at. I know how to get to a control if it is clearly named, but this control information I don't understand so well. I have attached a screenshot. The Window info tool can see the text I am looking for, i know that. I just need to figure out how to get to that control (or text) so I can capture it. Right now i am using a MouseClick command at coordinates in the window. It works, but seems sloppy. pk
Allochthonous Posted February 15, 2010 Author Posted February 15, 2010 Can anybody offer some insight? PK
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now