Jump to content

Yahoo Mail


 Share

Recommended Posts

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

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

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

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

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 by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

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

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 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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...