Jump to content

WinWaitActive()


Recommended Posts

I am using the following winwaitactive() function.

WinWaitActive("Family Christian Academy Database Administration - Microsoft Internet Explorer", "Last School Attended Listing - New Enrollments")

For some reason it isnt working. When I just pasted in here it put it on several lines that might be it... I am using notepad and it might have put a line break in on me. Any way I could look just for a bit of text on a page?

Thanks,

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

  • Developers

I am using the following winwaitactive() function.

WinWaitActive("Family Christian Academy Database Administration - Microsoft Internet Explorer", "Last School Attended Listing - New Enrollments")

For some reason it isnt working. When I just pasted in here it put it on several lines that might be it... I am using notepad and it might have put a line break in on me. Any way I could look just for a bit of text on a page?

Thanks,

JS

<{POST_SNAPBACK}>

Use AU3_Spy.exe to check the window title and the Text.

My guess would be that the text isn't detected...

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Oh dang!! :ph34r: I guess that would be the problem then. I would do a sleep, but that wouldnt work because the server could be slow for the day... what would you guys recommend? I am getting close to the end of this script.

Thanks,

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Oh dang!! :ph34r: I guess that would be the problem then. I would do a sleep, but that wouldnt work because the server could be slow for the day... what would you guys recommend? I am getting close to the end of this script.

Thanks,

JS

<{POST_SNAPBACK}>

statusbargettext

"I'm not even supposed to be here today!" -Dante (Hicks)

Link to comment
Share on other sites

Sweet. I thought I had seen a way around it. Thanks emmanuel.

JS

P.S. I'll let you know how this project turns out.

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Sweet. I thought I had seen a way around it. Thanks emmanuel.

JS

P.S. I'll let you know how this project turns out.

<{POST_SNAPBACK}>

btw, that'll only work on IE, you have to get more creative with other browsers

"I'm not even supposed to be here today!" -Dante (Hicks)

Link to comment
Share on other sites

Okay I am having a problem using that... I am trying to use a do until or even a while I tried at first.. :ph34r: here is the code I am trying...

Send("#r")
WinWaitActive("Run")
Send("http://www.familychristianacademy.com/admin{Enter}")
$status = StatusBarGetText("Family Christian Academy Database Administration - Microsoft Internet Explorer")
Do 
Sleep('1000')
$status = StatusBarGetText("Family Christian Academy Database Administration - Microsoft Internet Explorer")
Until $status = $done
;rest of stuff to do on that page here

Thanks for everything,

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Okay I am having a problem using that... I am trying to use a do until or even a while I tried at first.. :ph34r: here is the code I am trying...

Send("#r")
WinWaitActive("Run")
Send("http://www.familychristianacademy.com/admin{Enter}")
$status = StatusBarGetText("Family Christian Academy Database Administration - Microsoft Internet Explorer")
Do 
Sleep('1000')
$status = StatusBarGetText("Family Christian Academy Database Administration - Microsoft Internet Explorer")
Until $status = $done
;rest of stuff to do on that page here

Thanks for everything,

JS

<{POST_SNAPBACK}>

where is $done defined?

how about:

Until $status == "Done"

"I'm not even supposed to be here today!" -Dante (Hicks)

Link to comment
Share on other sites

Sorry I declared the global above... why is there a double ==? I will try it.

JS

Didnt work... Here is the code I have declaring the variable and setting it.

$g_szVersion = "Enroll Printer v1"
If WinExists($g_szVersion) Then Exit; It's already running
AutoItWinSetTitle($g_szVersion)
Global $done

$done = "Done"

Send("#r")
WinWaitActive("Run")
Send("http://www.familychristianacademy.com/admin{Enter}")
$status = StatusBarGetText("Family Christian Academy Database Administration - Microsoft Internet Explorer")
Do 
Sleep('1000')
$status = StatusBarGetText("Family Christian Academy Database Administration - Microsoft Internet Explorer")
Until $status = $done

That I think should help us along maybe...

Thanks again,

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

There is a bug in StatusbarGetText... put "" in the text field...

StatusbatGetText("title","")

and Sleep('1000') should be Sleep(1000)

Lar.

<{POST_SNAPBACK}>

The single quotes havent given me a problem but I will certainly remove them.

I will try the extra , "") at the end.

Thanks,

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Pardon me for jumping in a bit late to this... but I've had some luck reading "Done" as part of the "text" of the window. Is there a problem doing it this way? Is there an advantage to using StatusbarGetText?

AutoItSetOption ("WinTitleMatchMode", 2)

If WinExists ("Microsoft Internet Explorer", "") = 0 Then
   Run ("C:\Program Files\Internet Explorer\IEXPLORE.EXE")
EndIf

WinWait ("Microsoft Internet Explorer", "")
WinActivate ("Microsoft Internet Explorer", "")
WinWaitActive ("Microsoft Internet Explorer", "")
Send ("!d")
Send ("http://www.familychristianacademy.com/admin/{ENTER}")
WinWaitActive ("Family Christian Academy Database Administration", "Done")

...you might have to move your mouse to prevent it from being over a link that could change the status bar...

(edit: the code above assumes that the IE status bar is not hidden)

Edited by herewasplato

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

Link to comment
Share on other sites

...adding

AutoItSetOption ("WinDetectHiddenText", 1)
to the code I offered above works even if the status bar is hidden...

...it seems simpler than

Do 
Sleep(1000)
$status = StatusBarGetText("Family Christian Academy Database Administration - Microsoft Internet Explorer")
Until $status = $done
since the WinWait functions have a built in wait loop

...but I suppose that using WinDetectHiddenText in mode 1 must have its drawbacks or it would be the default parameter.

Thanks for reading my ramblings...

...hope the code offered is of some use to someone....later

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

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