Jump to content

Trying to automatically close a window


Recommended Posts

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] : )

Link to comment
Share on other sites

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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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] : )

Link to comment
Share on other sites

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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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] : )

Link to comment
Share on other sites

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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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