doogdoog Posted March 13, 2006 Share Posted March 13, 2006 Aloha, Don't laugh, but I have been working for a couple of days trying to start a program with a script. So far, I have come up with this to start the program: Runwait (@Comspec & "/c start dklite.msc") Ok, the program starts but a popup window appears over the program window that I want to start. Everytime the program starts, the popup is in a different location. I used Window Autoit Info and it only shows the title (Diskeeper Lite) and no control ID and no text. What can I use to close (click on the X) the popup window? I tried mouseclick, and controlclick and couldn't get it to work so far (for me). TIA Mahalo, doogdoog Link to comment Share on other sites More sharing options...
greenmachine Posted March 13, 2006 Share Posted March 13, 2006 Do you have to click on it? Or could you use the Win* functions, such as WinClose? Look them up in the helpfile. Link to comment Share on other sites More sharing options...
herewasplato Posted March 13, 2006 Share Posted March 13, 2006 ...Everytime the program starts, the popup is in a different location...See the help file for:AutoItSetOption ("MouseCoordMode", 0) ;Use Mouse Coordinates relative to window (1-rel to desktop)Be sure to change the "AutoIt Window Info" tool:Options > Coord Mode > Windowto get your x, y coordinates for a mouse click. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
doogdoog Posted March 13, 2006 Author Share Posted March 13, 2006 Aloha, Thanks for the reply. Yes, I have to click on the X and will take a look at Win* functions. TIA Mahalo, doogdoog Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 13, 2006 Moderators Share Posted March 13, 2006 Aloha, Thanks for the reply. Yes, I have to click on the X and will take a look at Win* functions. TIAMahalo, doogdoogI believe without knowing your window/program your trying to close, that greenmachine gave you the answer you are looking for. If it is a child window... you may want to do something like this: Opt('WinSearchChildren', 1) and use the WinClose('Title of annoying window', 'Any text that may be relevant'). 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...
doogdoog Posted March 13, 2006 Author Share Posted March 13, 2006 Aloha, Ok, there is a "close" button on the bottom of the popup if I scroll down. Mahalo, doogdoog Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 13, 2006 Moderators Share Posted March 13, 2006 Aloha, Ok, there is a "close" button on the bottom of the popup if I scroll down.Mahalo,doogdoogThat close button more than likely has a control ID so if it does, you could use ConrolClick('WindowTitle', 'Text of Control ID from AutoInfo Tool', 'Control ID Number or ClassNameNN'). Or again you could use the WinClose() 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...
doogdoog Posted March 13, 2006 Author Share Posted March 13, 2006 That close button more than likely has a control ID so if it does, you could use ConrolClick('WindowTitle', 'Text of Control ID from AutoInfo Tool', 'Control ID Number or ClassNameNN'). Or again you could use the WinClose()Aloha, Thanks for the reply and will try as suggested, but I just noticed something. It looks like when the program starts, there are two popups, one behind the other. The popup in back of the popup, closes after a second or so and then the front popup stays open. That's the one that closes by clicking on the X or the close button. I will try the controlclick and winclose again. TIAMahalo,doogdoog Link to comment Share on other sites More sharing options...
herewasplato Posted March 13, 2006 Share Posted March 13, 2006 ...greenmachine gave you the answer you are looking for...I forgot how specific WinClose can be... [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
doogdoog Posted March 13, 2006 Author Share Posted March 13, 2006 Aloha, Everyone, thanks for all the help. I finally got this simple script to work for me and it took all but 3 days! LOL I'll post the script: Runwait (@comspec & " /c start dklite.msc") Sleep (1000) WinClose ("Diskeeper Lite", "") ControlClick ("Diskeeper Lite","Defragment Now",8101,"",1) It looks like the "Sleep" was one of the key items to make it work. TIA Now for a beer to relax. Mahalo, doogdoog Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 13, 2006 Moderators Share Posted March 13, 2006 Aloha, Everyone, thanks for all the help. I finally got this simple script to work for me and it took all but 3 days! LOL I'll post the script: Runwait (@comspec & " /c start dklite.msc") Sleep (1000) WinClose ("Diskeeper Lite", "") ControlClick ("Diskeeper Lite","Defragment Now",8101,"",1) It looks like the "Sleep" was one of the key items to make it work. TIA Now for a beer to relax. Mahalo, doogdoogRunwait (@comspec & " /c start dklite.msc") WinWait("Diskeeper Lite", 5) WinClose ("Diskeeper Lite") If WinExists("Diskeeper Lite") Then ControlClick ("Diskeeper Lite", "Defragment Now", 8101) 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...
doogdoog Posted March 13, 2006 Author Share Posted March 13, 2006 Aloha, How do you use EnCodeIt?? After I download it, and then what?? TIA Mahalo, doogdoog Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 13, 2006 Moderators Share Posted March 13, 2006 Aloha, How do you use EnCodeIt?? After I download it, and then what?? TIAMahalo,doogdoogPretty simple, a file dialog pops up... then you choose the file that you want to encode, the method number, and then click the button. It will be in the same location as the file you wanted to encode was. 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...
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