SorryButImaNewbie Posted November 28, 2014 Share Posted November 28, 2014 Hello I'm constantly running in to problems with ControlGetText not getting the string from a textbox (mainly in PDF Creator 1.7.1 but in other windows too) I tried to use double ControlGetText, hoping that it would has a better succes rate, but if it did it is a negligible amount i think. Now I try to check if it get the text with an if loop and make try again till it get it. During this it occured to me that i don't know if i can invoke a textboxes text, asked google, found nothing, now I'm asking here I'm thinking like something ThunderRT6TextBox6.text. Is there something like this in aoutit? Also during my If loop I tried the syntax If ... or .... Then ..... EndIf . Tidy plate showed no error, script run, but never got in to the loop. would it work if it got in to the loop? would it check both thing after the IF or just the first? Thank you Link to comment Share on other sites More sharing options...
Geir1983 Posted November 28, 2014 Share Posted November 28, 2014 Also during my If loop I tried the syntax If ... or .... Then ..... EndIf . Tidy plate showed no error, script run, but never got in to the loop. would it work if it got in to the loop? would it check both thing after the IF or just the first? What is an if loop? Can you give an example of what youre code looks like? Link to comment Share on other sites More sharing options...
SorryButImaNewbie Posted December 4, 2014 Author Share Posted December 4, 2014 Hello Geir1983! Sorry for not responding for this long! Here is a code fragment you were asking for WinWaitActive("PDFCreator") Local $handle4 = WinGetHandle("PDFCreator") Sleep(1000) ControlFocus($handle4, "", "ThunderRT6TextBox5") ;I don't think this row is really needed, should I just remove it? Local $VJdate = "TesztVJ" & ControlGetText($handle4, "", "ThunderRT6TextBox5") ;saving date down to seconds, using it as an ID Sleep(200) If $VJdate = "TesztVJ" Then ControlClick("PDFCreator","","ThunderRT6TextBox5","left",2) Sleep(200) Send("{CTRLDOWN}c{CTRLUP}") $VJdate = "TesztVJ" & ClipGet() ;If for some reason it fails to retrive it from text box EndIf Sleep(200) MsgBox(0, "VJdate teszt", $VJdate) Sleep(1000) ControlSetText($handle4, "", "ThunderRT6TextBox6", $VJdate & "(1)KP") Sleep(500) ControlSetText($handle4, "", "ThunderRT6TextBox6", $VJdate & "(1)KP") Sleep(500) ControlClick("PDFCreator", "", "[CLASSNN:ThunderRT6CommandButton7]") ;Save button WinWaitActive("Mentés másként") ;Saveing window So I was wondering about if I can check the textbox's text somehow like ThunderRT6TextBox6.Text or .String something = "TesztVJ + 14 numeric character + (1)KP" and if its not it tries to set it again. By If loop I meant that the script goes in to the if -- EndIf branch. I wanted to add another if before saving, checking the textbox's string. Also If you have any additional suggestion to my code pls feel free to share. Thank you fro your help! (and sorry again for the response 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