Jump to content

Recommended Posts

All,

As always I've come here as a last resort. I would like to know if I could use multiple AdLibEnables....apparently I cannot. I've tried setting (2) different adlib functions but when I enable the second one, neither one works. Basically, there are two windows I want it to look for. can I set this all in one function? I am still a newbie so any help would be much appreciated. I was thinking something like this:

AdlibEnable("GetRidOfMemo2", 1000)
Exit


Func GetRidOfMemo2()
    If WinExists("Confirm", "&Accept") Then
        ControlClick("Confirm", "&Accept", "Button1")
    EndIf
    
    If WinExists("Conflict Resolution", "") Then
        ControlClick("Conflict Resolution", "", "Button12")
    EndIf
EndFunc

Would this work or am I dreaming??

Link to post
Share on other sites
  • Developers

AdlibEnable("GetRidOfMemo2", 1000)
While 1
   sleep(100)
Wend
Exit
Func GetRidOfMemo2()
    If WinExists("Confirm", "&Accept") Then
        ControlClick("Confirm", "&Accept", "Button1")
    EndIf
    
    If WinExists("Conflict Resolution", "") Then
        ControlClick("Conflict Resolution", "", "Button12")
    EndIf
EndFunc

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites
  • Developers

Why would I need the

While 1

    sleep(100)

Wend

???  Thanks for being patient!!!

<{POST_SNAPBACK}>

An Adlib is executed at the interval defined during the execution of the script.

Since your script ends right after the AdlibEnable() nothing happened.

So putting in an While 1...Wend keeps the script active.

You could ofcourse also put your test for the windows in the While...wend loop and forget about the adlib.....

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...