Jump to content

my first script


Recommended Posts

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?

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

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

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)

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