Jump to content
Sign in to follow this  

Returning to Previous Windows State

Recommended Posts

I wish my script to do the following: when new mail is pending, maximize Pegasus and click to download it, then return to the window I was viewing before. This works AOK except when the Desktop is on the screen. Code follows:

$t = WinGetText("Pegasus Mail")

$mailWaiting = StringInStr($t,"waiting on pop.gmail.com")

if $mailWaiting Then

$ar = MouseGetPos()

$winTit = WinGetTitle("")

WinActivate("Pegasus Mail")

WinWaitActive("Pegasus Mail")

MouseClick("left",421,50) ; download

WinSetState("Pegasus Mail","",@sw_minimize)

if $winTit<>"" Then WinWaitActive($winTit) ; if no window was active


if $winTit<>"" is intended to detect when no windows are maximized, but the script sometimes pauses on this line.

Is there a better way?



CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard


Share this post

Link to post
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
Sign in to follow this  

  • Create New...