Jump to content
Sign in to follow this  
schnarkle

Script works first time, doesnt afterwards.

Recommended Posts

schnarkle

This is a noob question for sure. I get two windows that pop up throughout the day as part of an application we use at work.

This is to make them go away as soon as they appear.

While 1
WinWaitActive("FreedomLINK : doug")
WinClose("FreedomLINK : doug")
WinWaitActive("Logoff Warning")
Send("{SPACE}")
Wend

I know this is super simple but it works the first time, just not after that.

Any ideas?

thanks!

Edited by schnarkle

Share this post


Link to post
Share on other sites
Noob

This is a noob trying to help another noob, so it may not necessarily be the best solution, but you may give it a try

While 1
    If WinActive("FreedomLINK : doug") Then WinClose("FreedomLINK : doug")
    If WinActive("Logoff Warning") Then Send("{SPACE}")
    Sleep(100)
Wend

Share this post


Link to post
Share on other sites
martin

This is a noob question for sure. I get two windows that pop up throughout the day as part of an application we use at work.

This is to make them go away as soon as they appear.

While 1
WinWaitActive("FreedomLINK : doug")
WinClose("FreedomLINK : doug")
WinWaitActive("Logoff Warning")
Send("{SPACE}")
Wend

I know this is super simple but it works the first time, just not after that.

Any ideas?

thanks!

Maybe the second time the title is slightly different. Possibly using

Opt("WinTitleMatchMode",2) at the start of the script will help.

Maybe you could use Autoit Window Info to check the second and compare it to the first.

Presumably you know that the 'space' is sent and that the script isn't stuck waiting for the Logoff warning to appear. MIght be worth putting a time limit in there just in case, eg

WinWaitActive("Logoff Warning",20)


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
PaulIA

This is a noob question for sure. I get two windows that pop up throughout the day as part of an application we use at work.

This is to make them go away as soon as they appear.

While 1
WinWaitActive("FreedomLINK : doug")
WinClose("FreedomLINK : doug")
WinWaitActive("Logoff Warning")
Send("{SPACE}")
Wend

I know this is super simple but it works the first time, just not after that.

Any ideas?

thanks!

Welcome to the forum. Have you tried putting debug messages lines after each line to see what is going on? For sure it's hanging on one of the WinWaitActive calls, but you will have to figure out which one. Use ConsoleWrite to put messages after each line and then run the app in SciTE.

Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites
schnarkle

Whoa give it up for Noob Power! It worked!

thanks for all the quick help!

:)

Edited by schnarkle

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  

×