Sign in to follow this  
Followers 0
SorryButImaNewbie

TextBox Text without variable?

3 posts in this topic

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

Share this post


Link to post
Share on other sites



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?

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0