twinnis Posted February 8, 2006 Share Posted February 8, 2006 Hi. I am trying to automate ntbackup via GUI and not the commandline. But problems start early. The Controlclick dont work at the first window. I am wondering if there could be a problem because I am using Swedish OS Windows XP Pro? Can it be the characters Å, Ä, Ö or is it because the control is hidden? The AUtoIt window info show: Press CTRL-ALT-F to pause the display. >>>>>>>>>>>> Window Details <<<<<<<<<<<<< Title: Guiden Säkerhetskopiera eller återställ Class: #32770 Size: X: 259 Y: 177 W: 506 H: 386 >>>>>>>>>>> Mouse Details <<<<<<<<<<< Window: X: 380 Y: 362 Cursor ID: 2 >>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<< RGB: Hex: 0xD4D0C8 Dec: 13947080 >>>>>>>>>>> Control Under Mouse <<<<<<<<<<< Size: X: 327 Y: 327 W: 78 H: 23 Control ID: 12325 ClassNameNN: Button4 Text: Slutför (Control is hidden) >>>>>>>>>>> Status Bar Text <<<<<<<<<<< >>>>>>>>>>> Visible Window Text <<<<<<<<<<< Välkommen till guiden Säkerhetskopiera eller återställ Den här guiden hjälper dig säkerhetskopiera eller återställa filer och inställningar på din dator. Om du vill kan du växla till <a>avancerat läge</a> och ändra inställningar för säkerhetskopiering eller återställning. Detta rekommenderas endast för avancerade användare. &Starta alltid i guideläge Klicka på Nästa om du vill fortsätta. < &Föregående &Nästa > Avb script: RunWait("ntbackup.exe") ControlClick("Guiden Säkerhetskopiera eller återställ", "Klicka på Nästa om du vill fortsätta.", 12325) The weird thing is that the text on the button is &Nästa > but as you can se in the Window info it shows Text: Slutför Nästa in Swedish means Next and Slutför means Finish. Is there anybody who can help me? Thanks in advance. /Twinnis Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 8, 2006 Moderators Share Posted February 8, 2006 (edited) If ControlCommand("Guiden Säkerhetskopiera eller återställ", "Slutför", 'Button4', 'IsVisible', '') Then ControlClick("Guiden Säkerhetskopiera eller återställ", "Slutför", 'Button4') Edit: Added CodeBox Edited February 8, 2006 by SmOke_N 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...
twinnis Posted February 8, 2006 Author Share Posted February 8, 2006 If ControlCommand("Guiden Säkerhetskopiera eller återställ", "Slutför", 'Button4', 'IsVisible', '') Then ControlClick("Guiden Säkerhetskopiera eller återställ", "Slutför", 'Button4') Edit: Added CodeBox Thanks for your answer SmOke_N. But it still doesn´t work. Any other ideas? /Twinnis Link to comment Share on other sites More sharing options...
twinnis Posted February 13, 2006 Author Share Posted February 13, 2006 Hi. I still havent solved the problem with AutoIt. But I guess that there is some problem with the Swedish characters because the script hang before it tries to send any mouseclicks. Its intressting that it works with VBScript as follows. Set objShell = WScript.CreateObject("WScript.Shell") objShell.Run "ntbackup.exe" Do Until Success = True Success = objShell.AppActivate("Guiden Säkerhetskopiera eller återställ") Wscript.Sleep 1000 Loop objShell.Sendkeys "%n" But I dont know how to click on radiobuttons with VB. Is there anyone that have any ideas on howe to solve this? I would be very grateful. Thanks! Best regards Twinnis Link to comment Share on other sites More sharing options...
twinnis Posted February 14, 2006 Author Share Posted February 14, 2006 Hi.I still havent solved the problem with AutoIt. But I guess that there is some problem with the Swedish characters because the script hang before it tries to send any mouseclicks. Its intressting that it works with VBScript as follows.Set objShell = WScript.CreateObject("WScript.Shell")objShell.Run "ntbackup.exe"Do Until Success = True Success = objShell.AppActivate("Guiden Säkerhetskopiera eller återställ") Wscript.Sleep 1000LoopobjShell.Sendkeys "%n"But I dont know how to click on radiobuttons with VB.Is there anyone that have any ideas on howe to solve this? I would be very grateful.Thanks!Best regardsTwinnisIt seems to be RunWait that doesn´t work with ntbackup.exe and not the Swedish characters. Instead I used WinWaitActive and the script is working fine./Twinnis 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