nikkiboi Posted July 22, 2008 Share Posted July 22, 2008 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 More sharing options...
Moderators SmOke_N Posted July 22, 2008 Moderators Share Posted July 22, 2008 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 More sharing options...
nikkiboi Posted July 22, 2008 Author Share Posted July 22, 2008 (edited) 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 July 22, 2008 by nikkiboi Link to comment Share on other sites More sharing options...
BrettF Posted July 22, 2008 Share Posted July 22, 2008 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) Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
nikkiboi Posted July 22, 2008 Author Share Posted July 22, 2008 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now