aommaster Posted April 7, 2008 Share Posted April 7, 2008 Hi guys! Okay... so let's just say some hypothetical person is having a lot of fun with the IE functions in autoit This hypothetical person wants to have autoit click a link in IE that partially matches the string he provides. For example, assume that below are links on a web page: *Home *Boards *News *Contacts *Departments *Art Gallery So, if autoit is provided the word "art" in the _IELinkClickbyText function, it will click departments if the index it is given is 0. If it is given 1, then it will click Art Gallery. Thanks guys! Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 7, 2008 Share Posted April 7, 2008 Hi guys! Okay... so let's just say some hypothetical person is having a lot of fun with the IE functions in autoit This hypothetical person wants to have autoit click a link in IE that partially matches the string he provides. For example, assume that below are links on a web page: *Home *Boards *News *Contacts *Departments *Art Gallery So, if autoit is provided the word "art" in the _IELinkClickbyText function, it will click departments if the index it is given is 0. If it is given 1, then it will click Art Gallery. Thanks guys! You could just hack your copy of IE.au3. Copy the _IELinkClickByText() function to a new name, i.e. _IELinkClickByString(), then change just one line inside the function: From:If $linktext = $s_linkText ThenoÝ÷ Ù:ºÚ"µÍYÝ[Ò[Ý ÌÍÛ[Ý^ ÌÍÜ×Û[Õ^ H[ 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 Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 7, 2008 Share Posted April 7, 2008 P.S. Don't expect support from Dale for any hacked versions of IE.au3... 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 Link to comment Share on other sites More sharing options...
aommaster Posted April 7, 2008 Author Share Posted April 7, 2008 P.S. Don't expect support from Dale for any hacked versions of IE.au3... Hehe... that is pure genius! It works perfectly!Strange he wouldn't give support... it's all his code with a minor tweak Link to comment Share on other sites More sharing options...
iTechTed89 Posted May 9, 2012 Share Posted May 9, 2012 I cant seem to get this working... but i think it would help solve my problem here possibly → Func _IELinkClickByString(ByRef $o_object, $s_linkText, $i_index = 0, $f_wait = 1) If Not IsObj($o_object) Then __IEErrorNotify("Error", "_IELinkClickByText", "$_IEStatus_InvalidDataType") Return SetError($_IEStatus_InvalidDataType, 1, 0) EndIf ; Local $found = 0, $linktext, $links = $o_object.document.links $i_index = Number($i_index) For $link In $links $linktext = $link.outerText & "" ; Append empty string to prevent problem with no outerText (image) links If $linktext = $s_linkText Then?oÝ?÷ Ù:ºÚ"µÍ?Y?Ý?[?Ò[?Ý? ?ÌÍ?Û[?Ý^ ?ÌÍ?Ü×Û[?Õ^ H[ If ($found = $i_index) Then $link.click() If $f_wait Then _IELoadWait($o_object) Return SetError(@error, 0, -1) EndIf Return SetError($_IEStatus_Success, 0, -1) EndIf $found = $found + 1 EndIf Next __IEErrorNotify("Warning", "_IELinkClickByText", "$_IEStatus_NoMatch") Return SetError($_IEStatus_NoMatch, 0, 0) ; Could be caused by parameter 2, 3 or both EndFunc Link to comment Share on other sites More sharing options...
iTechTed89 Posted May 9, 2012 Share Posted May 9, 2012 also wtf is oÝ÷ Ù:ºÚ"µÍYÝ[Ò[Ý ÌÍÛ[Ý^ ÌÍÜ×Û[Õ^ H[ ? Link to comment Share on other sites More sharing options...
BrewManNH Posted May 9, 2012 Share Posted May 9, 2012 That's a corrupted code tag, that isn't supposed to be there, which is why it's not working for you. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
iTechTed89 Posted May 9, 2012 Share Posted May 9, 2012 (edited) meaning? just use this?If $linktext = $s_linkText Then or is that the line i need to change and if so to what? Edited May 9, 2012 by iTechTed89 Link to comment Share on other sites More sharing options...
iTechTed89 Posted May 9, 2012 Share Posted May 9, 2012 still pretty lost on this wish dane made a function for this... i did see in anouther old topic he was thinking about it but dont know what became of it. Link to comment Share on other sites More sharing options...
BrewManNH Posted May 9, 2012 Share Posted May 9, 2012 You could ask PsaltyDS what he wrote there, he might recall it. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
iTechTed89 Posted May 11, 2012 Share Posted May 11, 2012 anyone got any advice on how to get this working i did msg DS but he hasnt been online since april Link to comment Share on other sites More sharing options...
DaleHohm Posted May 11, 2012 Share Posted May 11, 2012 Just use If StringInStr($linktext, $s_linkText) Then Dale 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 Link to comment Share on other sites More sharing options...
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