Jump to content

Recommended Posts

Posted

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:

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

MouseMove($ar[0],$ar[1])

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

Is there a better way?

...chris

Spoiler

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

 

Posted

Why don't you use ControlClick or ControlSend? Then your application can stay minimized.

Many thanks. ControlClick works fine.

...chris

Spoiler

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

 

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
×
×
  • Create New...