alexhuang Posted December 14, 2017 Share Posted December 14, 2017 (edited) This is my code and I get an error message:subscript used on non-accessible variable Can someone help me? Thanks Local $sText="" Local $teller =0 WinWaitActive("Open") Local $hWnd = ControlGetHandle("Open", "", 1148) ControlFocus("Open","",1148) Send($CmdLine[1]) $sText = ControlGetText($hWnd, "", 1148) While Not StringCompare($sText,$CmdLine[1]) And $teller < 3 WinWaitActive("Open") $hWnd = ControlGetHandle("Open", "", 1148) ControlFocus("Open","",1148) ControlSetText($hWnd,"",1148,"") Send($CmdLine[1]) $sText = ControlGetText($hWnd, "", 1148) $teller = $teller + 1 WEnd ControlClick("Open","",1) ;Send("{ENTER}") WinWaitClose("Open"[,""[,timeout=15]) Edited December 14, 2017 by JLogan3o13 Added code tags Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted December 14, 2017 Moderators Share Posted December 14, 2017 @alexhuang welcome to the forum. First and foremost, when posting please explain in detail what you are trying to accomplish - it is a lot better than asking us to guess. Secondly, post the output of the SciTE window that shows the error, as it should also show you which line the error is on (again, better than having us guess). Lastly, when posting code please use the code tags ( <> in your toolbar when posting), it makes it much easier to read. I have modified your original post so you can see what I mean. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
water Posted December 14, 2017 Share Posted December 14, 2017 "Add attachment" means "adding an attachment to an email"? If yes, which mail programm do we talk about? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Earthshine Posted December 14, 2017 Share Posted December 14, 2017 (edited) <snip> Edited December 15, 2017 by Earthshine spelling My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted December 14, 2017 Moderators Share Posted December 14, 2017 Ok, attacking someone brand new for not asking the question correctly is not something we want to start around here. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
alexhuang Posted December 14, 2017 Author Share Posted December 14, 2017 it's add attachment on website form and submit the form. Link to comment Share on other sites More sharing options...
water Posted December 14, 2017 Share Posted December 14, 2017 The last line of your script WinWaitClose("Open"[,""[,timeout=15]) is wrong. Brackets denote optional parameters. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
alexhuang Posted December 14, 2017 Author Share Posted December 14, 2017 thanks a lot and sorry for posting question the wrong way. Link to comment Share on other sites More sharing options...
water Posted December 14, 2017 Share Posted December 14, 2017 Never mind. We all started as newbies on this forum My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
alexhuang Posted December 19, 2017 Author Share Posted December 19, 2017 oeps It still doesn't work. Somehow it doesn't execute the code in While not StringCompare. Link to comment Share on other sites More sharing options...
alexhuang Posted December 19, 2017 Author Share Posted December 19, 2017 That is my window info Link to comment Share on other sites More sharing options...
alexhuang Posted December 19, 2017 Author Share Posted December 19, 2017 I changed my code but still doesn't work, I think it has something to do with "Edit1" , perhaps I shoud use something else. Link to comment Share on other sites More sharing options...
BigDaddyO Posted December 19, 2017 Share Posted December 19, 2017 (edited) all your WinWaits, you have the Control where the Window title should be. Would be more like WinWait("Open", "", 2) Edited December 19, 2017 by BigDaddyO Link to comment Share on other sites More sharing options...
alexhuang Posted December 26, 2017 Author Share Posted December 26, 2017 thanks 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