eber Posted November 23, 2010 Posted November 23, 2010 Dear experts, I am new to AutoIt and try to automate a disc imaging tool named "EASEUS ToDo Backup". I started by the notepad example from autoit and tried to master the EASEUS tool. Anyhow, after about one hour with zero success, I switched from using "send ("!F") (for the file menu) to using the cursor keys to navigate the buttons. Reason: The "send" command does NOT send "alt-x" to the "EASEUS ToDO Backup" tool. It also does NOT send an "\" to a text field in the "EASEUS ToDo Backup" software. And that's the point where I am totally stuck: I try to send "c:\folder\file.ext" to a "file" field in EASEUS. I use: send("c:\folder\file.ext",1) and get in the textfield: "c:filefolder.ext" I also tried : send("c:") send("{ALTDOWN}{NUMPAD0}{NUMPAD9}{NUMPAD2}{ALTUP}") send("file") send("{ALTDOWN}{NUMPAD0}{NUMPAD9}{NUMPAD2}{ALTUP}") send("file.ext") and get the very same result ? Does anyone have any hint ? With best Regards, Wolfgang Ebersbach
water Posted November 23, 2010 Posted November 23, 2010 Hallo Wolfgang, sending keys to an application is where I started myself ages ago. But it gets safer and (most of the time) easier to code when you directly access the controls (in your case th input field). Use the AutoIt Window Info tool to get the ID of the input field. Then you can use ControlSend to populate the input field. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
eber Posted November 23, 2010 Author Posted November 23, 2010 (edited) Hello water, so, I did try your suggestion and send the text to the control via: ControlSend("Restore Data Wizard","","[CLASS:gdkWindowChild; Instance:9]","c:\drivebackups\avaxt_win7_image.pbd",1) I did find out the control class and ID with the WindowIfo tool. Anyhow, the results is EXACTLY the same; The "\" are missing. Very strange.. If I try "ControlSetText", I get nothing into my control. Hallo Wolfgang, sending keys to an application is where I started myself ages ago. But it gets safer and (most of the time) easier to code when you directly access the controls (in your case th input field). Use the AutoIt Window Info tool to get the ID of the input field. Then you can use ControlSend to populate the input field. Edited November 23, 2010 by eber
eber Posted November 23, 2010 Author Posted November 23, 2010 More strange things: If I manually enter the corrent drive, path and filename for my backup into the control with the Instance Number "9", right after entering the whole filename, the Instance number of this control changes from "9" to "41" ? All the controls do not have any "Name" or "ID" according to the WindowInfo tool. ???
water Posted November 23, 2010 Posted November 23, 2010 Could you try to remove the flag. This is for special cases where you don't want Autoit to interpret the string. ControlSend("Restore Data Wizard","","[CLASS:gdkWindowChild; Instance:9]","c:\drivebackups\avaxt_win7_image.pbd") My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
eber Posted November 23, 2010 Author Posted November 23, 2010 Makes no difference. I did try with and without flag already, and also with the regular "send" command. So, for this application, "Send" and "ControlSend" show exactly the same behaviour. OK, that's what's expected but in my case its not so good. Where are my "\" ?? Code: ( The commented region is the working version with simulating cursor keys. This is of course very unreliable because I select the file by moving the cursor keys around in the "open file" dialog/window area ... ) ; Clone_hdd.au3 ; script to run easus todo backup Run("c:\programme\EASEUS\EASEUS Todo Backup 1.1\bin\loader.exe","c:\programme\EASEUS\EASEUS Todo Backup 1.1\bin") WinWaitActive("EASEUS") Sleep(1000) ;Send("{DOWN 6}") ControlClick("EASEUS Todo Backup","","[CLASS:gdkWindowChild; INSTANCE:13]") ;Send("{ENTER}") WinWaitActive("Restore Data Wizard") ControlClick("Restore Data Wizard","","[Class:gdkWindowChild; Instance:9]") ; this is to get the focus ControlSend("Restore Data Wizard","","[CLASS:gdkWindowChild; Instance:9]","c:\drivebackups\avaxt_win7_image.pbd",1) ; this works but the \ are missing; also without flag ControlClick("Restore Data Wizard","","[Class:gdkWindowChild; Instance:3]") ; Click on the "do it" button; The buttons Instance number changes as soon as the file name is entered into the control above ??? ;~ send("{DOWN 2}") ; Platte C wählen ;~ send("{RIGHT}") ; Aufklappen ;~ send("{DOWN 8}") ; Verzeichnsi drivebackups wählen ;~ send("{RIGHT}") ; Aufklappen ;~ send("{DOWN}") ; Datei wählen ;~ send("{ENTER}") ; starten ;~ send("{TAB}") ; Wählen was restored werden soll ;~ send("{SPACE}") ; Nämlich alles ;~ send("{TAB}") ; weiter ;~ send("{TAB}") ; Zum ;~ send("{ENTER}") ; next Button ;~ send("{DOWN 3}") ; physikalische HDD 3 wählen ;~ send("{TAB}") ; weiter ;~ send("{TAB}") ; zum ;~ send("{ENTER}") ; NEXT Button ; ToDo: Wenn nicht leere Platte drin ist, "ja trotzdem" Abfrage bestätigen ;~ send("{TAB}") ; Ja ;~ send("{TAB}") ; Ja ich will ;~ send("{ENTER}") ; wirklich ;~ WinWaitActive("Succeed") ;~ send("{ENTER}") ;~ send("{TAB}") ;~ send("{ENTER}")
eber Posted November 24, 2010 Author Posted November 24, 2010 I did now use the recorder ro record what's happening when I use the program manually. This is what the recorder records for my file input field input: Send("c{SHIFTDOWN}⸀{SHIFTUP}{CTRLDOWN}{ALTDOWN}{CTRLUP}{ALTUP}drivebackups{CTRLDOWN}{ALTDOWN}{CTRLUP}{ALTUP}avaxt{SHIFTDOWN}ⴀ{SHIFTUP}win7{SHIFTDOWN}ⴀ{SHIFTUP}image⸀pbd") If I paste this into scite, the nono-printable characters show up as ? (Questionmarks) Besides the fact that this does also not work, a new question came up: - Why is the dot in "image.pbd" recorder as non-printable character ? It's a plain ASCII.. - Also the _ is recorder as non-printable, but it's just <shift>- at the german keyboard.. OK, I did cut this down to: Send("c:{CTRLDOWN}{ALTDOWN}?{CTRLUP}{ALTUP}drivebackups{CTRLDOWN}{ALTDOWN}?{CTRLUP}{ALTUP}avaxt_win7_image.pbd") which is correct because at the german keyboard, <CTRL><ALT>? is the \, and this works if typed in. And guess the result ... right: "c:drivebackupsavaxt_win7_image.pbd" is written to the input field ...
water Posted November 24, 2010 Posted November 24, 2010 (edited) Send("c:{CTRLDOWN}{ALTDOWN}?{CTRLUP}{ALTUP}drivebackups{CTRLDOWN}{ALTDOWN}?{CTRLUP}{ALTUP}avaxt_win7_image.pbd")I really don't know what's going on but I would try the following: Send("c:{ASC 092}drivebackups{ASC 092}avaxt_win7_image.pbd") I was playing a bit and got the impression that the Alt key might be "consumed" by the application itself. This notation is working fine for me when used with notepad. Edited November 24, 2010 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
eber Posted November 24, 2010 Author Posted November 24, 2010 Well, this application (EASEUS ToDO Backup) seems to block anything that is not letters from beeing sent by AutIt. I did try: Send("c:{ASC 092}drivebackups{ASC 092}avaxt_win7_image.pbd") which did not work ( \ missing) for curiosity I did then: Send("c:{ASC 090}drivebackups{ASC 090}avaxt_win7_image.pbd") Result : The "Z" is also missing ! Also with {ASC 093}, there is no "]" in the output string If I add the Flag (,1) to the SEND command, I get: c:ASC 092drivebackupsASC 092avaxt_win7_image.pbd Note: The { and } are missing ! Any alternate ideas ? Any API calls to send an \ to this app ? I do not understand this behaviour as all the non-working characters are within the low ASCII range and therefore should work. Even UTF8 is the same in the range 0-127, right ? So, what's going on here ? Thanks for your help so far, but this seems to be a hard one. Regards, Wolfgang
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