Jump to content
Sign in to follow this  
nikkiboi

my first script

Recommended Posts

nikkiboi

Hi, this is my first script and the reason i am writing it is because i want to eliminate the need to keep clicking on a dialog button when it keeps popping up. now i have tried writing it but keep getting an error.

;Script to close annoying ACT! dialog box

$WinWait = WinWait ( "ACT! Address Book")

if $WinWait = 0 then

;i want it to keep cycling

Else

ControlClick ( "ACT! Address Book", "The ACT! Address Book service is not properly configured, or the configured database is locked. Do you want to configure it now?", 7 [, left [, 1]] )

EndIf

now i dont know how to make it keep cycling so that it just keeps checking for the window and if it finds it, it closes it or if it doesnt it just starts again. I did try and do another if then else with another variable, but that didnt work.

for the control click the controlid of 7 is correct as i used the window finder to asertain that, also the left mouse click and 1 click is also correct. Title name, and dialog in the window are also correct.

Can anyone give me some pointers about this?

Share this post


Link to post
Share on other sites
SmOke_N

You'll need to wrap it in a loop, check the help file for: While/WEnd | Do/Until | For/Next


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
nikkiboi

You'll need to wrap it in a loop, check the help file for: While/WEnd | Do/Until | For/Next

i did this:

;Script to close annoying ACT! dialog box
$cycle = 1
Do
    $WinWait = WinWait ( "ACT! Address Book")
    if $WinWait = 1 then 
        ControlClick ( "ACT! Address Book", "The ACT! Address Book service is not properly configured, or the configured database  is locked.  Do you want to configure it now?", 7 [, left [, 1]] )
        $cycle = 1
    else 
        $cycle = 1
    EndIf
Until $cycle = 0

i did a check and get this error.

AutoIt3 Syntax Checker v1.54.8  Copyright (c) Tylo 2007

C:\Scripts\act!.au3(7,175) : ERROR: syntax error
        ControlClick ( "ACT! Address Book", "The ACT! Address Book service is not properly configured, or the configured database  is locked.  Do you want to configure it now?", 7 [
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Scripts\act!.au3 - 1 error(s), 0 warning(s)
>Exit code: 2   Time: 0.214

what is going wrong here? and is that do/until alright?

Edited by nikkiboi

Share this post


Link to post
Share on other sites
BrettF

You may see [] in functions in the helpfile, but that is only to tell the reader that the paramaters are optional. muttley

ControlClick ( "ACT! Address Book", "The ACT! Address Book service is not properly configured, or the configured database is locked. Do you want to configure it now?", 7)

Share this post


Link to post
Share on other sites
nikkiboi

bloody legend....thanks bert and smoke.

with the [, left]

i thought even though it was optional you would still have to specify betweeen left and right click etc.

thanks for you help, works beautifully.

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  

×