Jump to content
Sign in to follow this  
roundar

Trying to automatically close a window

Recommended Posts

roundar

I'm using software that occasionally pops up an alert titled 'Confirm' with the options 'yes' and 'no.' I want to automatically sent {ENTER} when it pops up, but this does not seem to be doing the trick. What am I missing?

Here's the entire script:

while 1
   While WinExists("Confirm")
    WinActivate("Confirm")
    Send("{ENTER}")
   WEnd
WEnd
Edited by roundar

: ([font=courier new,courier,monospace] EndFunc[/font] : )

Share this post


Link to post
Share on other sites
water

Something like this?

While 1
    If WinExists("Confirm" Then
        WinActivate("Confirm")
        Send("{ENTER}")
    EndIf
    Sleep(1000) ; Check is done every second
Wend


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
roundar

That wasn't working either. I played around and got it to work by using some of the text in the window. There are no controls for the window itself, only "basic window info." I can't figure out why I can't find the window with the basic info.

Edited by roundar

: ([font=courier new,courier,monospace] EndFunc[/font] : )

Share this post


Link to post
Share on other sites
roundar

I see IfMsgBox in the Notes for users familiar with AutoIt 2.64. Is this an option?


: ([font=courier new,courier,monospace] EndFunc[/font] : )

Share this post


Link to post
Share on other sites
water

That wasn't working either. I played around and got it to work by using some of the text in the window.

Does this mean it is working now and you can send ENTER to the window and it closes?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
roundar

Yes. ControlFocus, WinExists, and similar functions were not working with the title alone, I had to include text from the window or control. Also, I don't know why IfMsgBox is listed as a function, but It obviously wasn't what I was looking for.

Edited by roundar

: ([font=courier new,courier,monospace] EndFunc[/font] : )

Share this post


Link to post
Share on other sites
roundar

oic.

Edited by roundar

: ([font=courier new,courier,monospace] EndFunc[/font] : )

Share this post


Link to post
Share on other sites
water

Please make sure that you have read the forum rules carefully: "Do not discuss any of the following: Automating games or game servers. ..."

The Mods are quite strict with this rules.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
roundar

Ohh ok. It's pretty close to automating routine tasks on the computer, but I understand the rule. ty


: ([font=courier new,courier,monospace] EndFunc[/font] : )

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  

×