Kane Posted April 27 Share Posted April 27 (edited) I am also getting the "Unterminated string" error. More specifically, for the line Local $idRdo2=ControlGetHandle($hDlgWnd,"","[TEXT:5 Hours Data]”) Below is the code. Can anyone please take a quick look? Much appreciated! expandcollapse popupLocal $title="[TITLE:Some Software V7.632;CLASS:#32770]" WinActivate($title) Local $hLoginWnd=WinWaitActive($title) ;Download Data Start Sleep(500) ControlClick($hLoginWnd,"","[CLASS:AfxWnd100;INSTANCE:12]") EndFunc Func PopDownloadDlg() ;Find the Main Window Open the Dialog Box Local $title="[CLASS:TdxW_MainFrame_Class]" WinActivate($title) Local $hMainWnd=WinWaitActive($title) SendKeepActive($hMainWnd) WinMove($hMainWnd,"",0,0,300,600) ;Click Datadownload ;Move to the Option ;Avoid using Mouse without Borders ControlClick($hMainWnd,"",3000) ControlClick($hMainWnd,"","[CLASS:AfxWnd42;INSTANCE:9]") ;Go down 10 lines to find the corresponding data download command Send(‘{DOWN 10}{ENTER}’) EndFunc Func SetCheckDownloadDlg() ;Click and Download Local Stitle="[TITLE:Data Download;CLASS:#32770]" WinActivate($title) Local $hDlgWnd=WinWaitActive($title) ;Check the radio button on page one Sleep(500) Local $idRdo2=ControlGetHandle($hDlgWnd,"","[TEXT:5 Hours Data]”) _GUICtrlButton_SetCheck($idRdo2) ;Activate All Tabs in Turn Check the radio buttons Local $idTab=ControlGetHandle($hDlgWnd,","[CLASS:SysTabControl32;INSTANCE:1]") _GUICtrlTab_SetCurFocus($idTab,0) _GUICtrITab_SetCurFocus($idTab,1) _GUICtrlTab_SetCurFocus($idTab,2) _GUICtrlTab_SetCurFocus($idTab,4) _GUICtrlTab_SetCurFocus($idTab,5) EndFunc Func ClickDownloadDlg) Local $title="[TITLE:Data Download;CLASS:#32770]" WinActivate($title) Local $hDlgWnd=WinWaitActive($title) ;Download Start Sleep(500) ControlClick($hDlgWnd,"","[TEXT:Download Start]") EndFunc Func WaitDownloadDlg() ;Download Start Sleep(500) Local $title="[TITLE:Data Download;CLASS:#32770]" WinActivate($title) Local $hDlgWnd=WinWaitActive($title) Local $idtext=" Do Sleep(2000) $idtext=ControlGetText($hDlgWnd,"","[CLASS:Static;INSTANCE:2]") Until‘Download Completed’=$idtext ;Until‘Download Cancel’=$idtext ;Wait for Message that show Download Complete EndFunc Func ExitMain() ;Exit Local $title="[TITLE:Data Download;CLASS:#32770]" WinActivate($title) Local $hDlgWnd=WinWaitActive($title) WinClose($hDlgWnd) ControlClick(tatic;INSTANCE:2]") Until‘Download Completed’=$idtext ;Until‘Download Cancel’=$idtext ;Wait till Download Completed EndFunc Func ExitMain() ;Need to Exit Dialog Box otherwise Software is Still On Local $title="[TITLE:Data Download;CLASS:#32770]" WinActivate($title) Local $hDlgWnd=WinWaitActive($title) WinClose($hDlgWnd) ControlClick($hDlgWnd,"","[TEXT:关闭]") Sleep(500) ;Close Window Local $title="[CLASS:TdxW_MainFrame_Class]" WinActivate($title) Local $hMainWnd =WinWaitActive($title) WinClose($hMainWnd) ;Confirm Exit Local $hMainWnd=WinWaitActive("[TITLE:Exit Confirmation CLASS:#32770]") ControlClick($hMainWnd,"","[TEXT:Exit") EndFunc Edited April 27 by Jos added codebox Link to comment Share on other sites More sharing options...
Developers Jos Posted April 27 Developers Share Posted April 27 (edited) The posted code is invalid as it contains an endfunc on line 7 without a starting Func, so please post a runnable script first when you like to get some help. Also get rid of these invalid literal string definitions like Until‘Download Completed’ A proper literal string is 'Dowload Complered' or "Dowload Complered". PS: No need to resurrect an 11 years old topic to post your issue! Split of the post into its own topic and added a codebox Edited April 27 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Kane Posted April 27 Author Share Posted April 27 1 hour ago, Jos said: The posted code is invalid as it contains an endfunc on line 7 without a starting Func, so please post a runnable script first when you like to get some help. Also get rid of these invalid literal string definitions like Until‘Download Completed’ A proper literal string is 'Dowload Complered' or "Dowload Complered". PS: No need to resurrect an 11 years old topic to post your issue! Split of the post into its own topic and added a codebox Thanks for your comments. I am just a newbie bumped into Autoit. Will look into it. PS: If I do not post the code, expert like you would not know what I was talking about. Again thanks for taking the time. 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