Snarg Posted March 11, 2006 Share Posted March 11, 2006 I am trying to do what I thought would be relativly simple. I am trying to open the first message in a folder in Yahoo Mail, regardless of the messages subject. Since the subjct can be anything, a simple _IEClickLinkByText() won't work. I have messed around with _IEClickLinkByIndex() however the index is prone to change so that method is unreliable. The folders are in an HTML form called 'messageList': <!-- START MAIN APPLICATION CONTENT --> <form name=messageList method=post action="/ym/ShowFolder?YY=17723&inc=25&order=down&sort=date&pos=0&view=a&head=b&box=Inbox"> The first message in the folder has a form element name of 'folderviewmsg0subjlink'. I was hoping to be able to do something with that however I am failing miserably. <td> <a id="folderviewmsg0subjlink" href="/ym/ShowLetter?MsgId=8388_1990131_1559_1777_572_0_1491_-1_0&Idx=0&YY=17723&inc=25&order=down&sort=date&pos=0&view=a&head=b&box=Inbox"> Test3 </a> </td> These are the things I have tried: ;$o_MessageListForm = _IEFormGetObjByName ($o_IE, "messageList") ;$o_FirstMessage = _IEFormElementGetObjByName ($o_MessageListForm, "folderviewmsg0subjlink") ;_IEClickLinkByIndex ( $o_MessageListForm, $o_FirstMessage ) ;_IEClickLinkByText ($o_IE, $o_FirstMessage) There have been other attempts using different methods however I don't have all of them here. I have been wrestling with this for a couple hours now and now come here with my hat in my hands hoping for some help. Thanks in advance. A little reading goes a long way. Post count means nothing. Link to comment Share on other sites More sharing options...
Snarg Posted March 11, 2006 Author Share Posted March 11, 2006 Ugh! Having to go the ugly route for right now. Using MouseMove and MouseClick. As usual, any help would be greatly appreciated. A little reading goes a long way. Post count means nothing. Link to comment Share on other sites More sharing options...
Confuzzled Posted March 12, 2006 Share Posted March 12, 2006 Would sending a few {tab} keys do the job? Link to comment Share on other sites More sharing options...
Snarg Posted March 12, 2006 Author Share Posted March 12, 2006 Would sending a few {tab} keys do the job?I was hoping for something a bit more robust If something changes on the page then I have to change the whole script. A little reading goes a long way. Post count means nothing. Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted March 12, 2006 Share Posted March 12, 2006 quick question will you have yahoo mail already logged in on IE or do u want it to like auto log you in and are you just saying u want it to go to the first message right when you open it? Link to comment Share on other sites More sharing options...
Snarg Posted March 12, 2006 Author Share Posted March 12, 2006 quick question will you have yahoo mail already logged in on IE or do u want it to like auto log you in and are you just saying u want it to go to the first message right when you open it?The script opens IE, navs to Yahoo mail, logs in, selects a folder and then...That is where I have troubles. I can use a hard coded MouseMove/MouseClick however the code would not be portable and it is very prone to error if one little thing throws off the alignment. A little reading goes a long way. Post count means nothing. Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted March 12, 2006 Share Posted March 12, 2006 post ur script Link to comment Share on other sites More sharing options...
DaleHohm Posted March 12, 2006 Share Posted March 12, 2006 The following should do the trick. $o_IE.document.getElementByID("folderviewmsg0subjlink").click There are a couple of new functions in the upcoming version of IE.au3 that will make this more intuitive 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...
herewasplato Posted March 12, 2006 Share Posted March 12, 2006 (edited) I was hoping for something a bit more robust If something changes on the page then I have to change the whole script.Well, until Dale comes by :-) add this to your script:AutoItSetOption("WinWaitDelay", 1) AutoItSetOption("WinDetectHiddenText", 1) Do WinActivate("Yahoo! Mail") Send("{TAB}") Until WinExists("Yahoo! Mail", "ShowLetter?MsgId=") Send("{ENTER}") edit:...such timing Dale... edit2:...slight code change - like it matters :-( [Thanks Dale for that great UDF - perhaps someday I'll figure it out.] Edited March 12, 2006 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted March 12, 2006 Share Posted March 12, 2006 Well, until Dale comes by :-) add this to your script:Do WinActivate("Yahoo! Mail") Send("{TAB}") Sleep(10) Until WinExists("Yahoo! Mail", "ShowLetter?MsgId=") Send("{ENTER}") edit:...such timing Dale... that made my day Link to comment Share on other sites More sharing options...
Snarg Posted March 12, 2006 Author Share Posted March 12, 2006 DaleHohm, thank you so much kind sir. First, your great library, second the service and support you provide. I have two questions now, still somewhat relevant to the first. 1) What references can I look at to find out what this means $o_IE.document.getElementByID("folderviewmsg0subjlink").click I mean, thank you for the code however, where can I find out what makes this work? 2) Without getting into a huge ammount of string manipulations, is there a way to feed _IEClickLinkByText() wildcards? A little reading goes a long way. Post count means nothing. Link to comment Share on other sites More sharing options...
DaleHohm Posted March 14, 2006 Share Posted March 14, 2006 (edited) DaleHohm, thank you so much kind sir. First, your great library, second the service and support you provide. I have two questions now, still somewhat relevant to the first. 1) What references can I look at to find out what this means $o_IE.document.getElementByID("folderviewmsg0subjlink").click I mean, thank you for the code however, where can I find out what makes this work? 2) Without getting into a huge ammount of string manipulations, is there a way to feed _IEClickLinkByText() wildcards?You're welcome. 1) the most complete source is msdn.microsoft.com - you'll find info about the example if you search for getElementByID 2) _IEClickLinkByText() already does a substring match. If you want wildcards you'll need to study the source of the function and write your own. Dale Edited March 14, 2006 by DaleHohm 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