Jump to content

Easy Question


Recommended Posts

It's been a while since I've used AutoIt, but came up with a use, I'm sure other people have thought of or done ir already. However my code isn't working. I tested it with msgbox and I can't get either ControlGetText or StatusBarGetText to return text. I tried the Status bar at first, but then tried ControlGetText cuz I thought maybe MS IE doesn't use a standard statusbar. I tried using both the ControlName and ID I got from AutoItWindowInfo utility. All I get is blank when displaying the text in a test msgbox.

I'm sure it's an easy problem to solve, I just can't see what I did wrong!:P

Thanks,

Close ;)

;Checks First External Email, also tried msctls_statusbar321 to no avail 
;also assumes that you don't use cookies w/yahoo
;so it enters username & password
run("C:\Program Files\Internet Explorer\IEXPLORE.EXE")
winwaitactive("Sign in to Yahoo")
winactivate("Sign in to Yahoo")
sleep(100)
Send("username{TAB}")
send("password")
send("{ENTER}")
While not winwaitactive("Yahoo! Mail")
 if winactive("Security") then
  send("{ENTER}")
 endif
wend
sleep(50)
$statustext=ControlGetText("Yahoo!Mail", "", 40961)

While StringInStr ($statustext, "FOOT")=0 
 if StringInStr ($statustext, "External")>0 then
 ;Send("{TAB 32}{ENTER}")
  send("{Enter}")
 endif
 sleep(100)
 Send("{TAB}")
 $statustext=ControlGetText("Yahoo!Mail", "", 40961)
;$statustext=StatusBarGetText("Yahoo!Mail")
wend
Link to comment
Share on other sites

It's been a while since I've used AutoIt, but came up with a use, I'm sure other people have thought of or done ir already. However my code isn't working. I tested it with msgbox and I can't get either ControlGetText or StatusBarGetText to return text. I tried the Status bar at first, but then tried ControlGetText cuz I thought maybe MS IE doesn't use a standard statusbar. I tried using both the ControlName and ID I got from AutoItWindowInfo utility. All I get is blank when displaying the text in a test msgbox.

I'm sure it's an easy problem to solve, I just can't see what I did wrong!:P

Thanks,

Close ;)

;Checks First External Email, also tried msctls_statusbar321 to no avail 
;also assumes that you don't use cookies w/yahoo
;so it enters username & password
run("C:\Program Files\Internet Explorer\IEXPLORE.EXE")
winwaitactive("Sign in to Yahoo")
winactivate("Sign in to Yahoo")
sleep(100)
Send("username{TAB}")
send("password")
send("{ENTER}")
While not winwaitactive("Yahoo! Mail")
 if winactive("Security") then
  send("{ENTER}")
 endif
wend
sleep(50)
$statustext=ControlGetText("Yahoo!Mail", "", 40961)

While StringInStr ($statustext, "FOOT")=0 
 if StringInStr ($statustext, "External")>0 then
;Send("{TAB 32}{ENTER}")
  send("{Enter}")
 endif
 sleep(100)
 Send("{TAB}")
 $statustext=ControlGetText("Yahoo!Mail", "", 40961)
;$statustext=StatusBarGetText("Yahoo!Mail")
wend
you should check out dale's IE.au3, that'll make things very easy on this one. there are several links to it in the support forum, and a few people have done this exact thing also, you should be able to find a script to use as an example to troubleshoot yours..
Link to comment
Share on other sites

I agree with cameronsdad that you should use IE.au3 since it will log you on to Yahoo! much, MUCH faster than the script you have created. I use Firefox so I prefer not to use IE unless I have to; however, I do use an AutoIt script using IE.au3 to log on to my Yahoo! mail.

If you would rather not use IE.au3 (for some odd reason) you can modify your script just a little to make it work.

Instead of using

$statustext=ControlGetText("Yahoo!Mail", "", 40961)

try using

Do

$statustext = WinGetText ("Sign in to Yahoo", "Done")

Sleep (100)

Until $statustext = "Done"

Edit:I also recommend you use Opt ("WinTitleMatchMode", 4)

Edited by SerialKiller
Link to comment
Share on other sites

I agree with cameronsdad and SerialKiller that you should use IE.au3 - however; see this post for a script that might do what you want: http://www.autoitscript.com/forum/index.ph...=ST&f=9&t=14395

YEs I"m going to try the UDF.

Just not sure where in the source to find the FORM object variable. I see in the example he posted for that, but couldn't see how he got it for yahoo or hotmail. I looked at the source files. Anyone know how or where to look?

Thanks ;)

Thanks, but I already can login to yahoo. I was trying to check my 'external accounts'. I tried reading the statusbar but to no avail. I'll try the IE3 udf.

If you would rather not use IE.au3 (for some odd reason) you can modify your script just a little to make it work.

Instead of using

$statustext=ControlGetText("Yahoo!Mail", "", 40961)

try using

Do

$statustext = WinGetText ("Sign in to Yahoo", "Done")

Sleep (100)

Until $statustext = "Done"

Edit:I also recommend you use Opt ("WinTitleMatchMode", 4)

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