Jump to content

Script works first time, doesnt afterwards.


Recommended Posts

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
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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