Fission102 Posted January 8, 2016 Share Posted January 8, 2016 Hey everyone, Just a quick question, tried searching about it, but didn't really find exactly what I needed.So the situation is for example I did a few commands as follows to simply highlight and copy an integer from a textbox. MouseClick("left", $Highlightx, $Highlighty) ; Highlight textbox MouseClick("left", $Highlightx, $Highlighty) Send("{CTRLDOWN}c{CTRLUP}")How do I take that copied integer and compare it with another integer using If statements? Is there some command that I'm not finding? For exampleMouseClick("left", $Highlightx, $Highlighty) ; Highlight textbox MouseClick("left", $Highlightx, $Highlighty) Send("{CTRLDOWN}c{CTRLUP}") Local $iValue = Int("{CTRLDOWN}c{CTRLUP}") If ($iValue > 100 ) Then _Reset() Else Sleep (50) EndIfNow obviously it doesn't work lol, but I'm unsure of what code is needed to check that stored "copied" integer from the textbox. Any help would be great!Thanks. Link to comment Share on other sites More sharing options...
jdelaney Posted January 8, 2016 Share Posted January 8, 2016 (edited) what kind of textbox. Use ControlGetText, or one of the _IE functions.And you would use clipget to get the value you copy...but that's got to be the most inefficient and inaccurate way to do it. Edited January 8, 2016 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Fission102 Posted January 8, 2016 Author Share Posted January 8, 2016 (edited) what kind of textbox. Use ControlGetText, or one of the _IE functions.It's a standard web textbox similar to what we're using now to reply. Hmm never used these types of codes before.edit: thanks for the fast reply btw!! Edited January 8, 2016 by Fission102 response Link to comment Share on other sites More sharing options...
jdelaney Posted January 8, 2016 Share Posted January 8, 2016 Get the object using the _ie functions, and then on the object, grab the ".text". IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Fission102 Posted January 8, 2016 Author Share Posted January 8, 2016 Get the object using the _ie functions, and then on the object, grab the ".text".Which function _IE are you referring to? Sorry I checked the help bar and it showed many different types of coding. Really unfamiliar with this section haha. Link to comment Share on other sites More sharing options...
jdelaney Posted January 8, 2016 Share Posted January 8, 2016 You'll need them all. Check the help file examples, and try them out. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Rampantshadow Posted January 8, 2016 Share Posted January 8, 2016 Hi Fission,you can use:If IsInt($iValue) Then if $iValue > 100 Then _Reset() EndIf Else MsgBox(0,"Not Int","The Value Copied is not recognized as an Int") EndIfgive that a crack and see what it returns for you. Link to comment Share on other sites More sharing options...
Fission102 Posted January 8, 2016 Author Share Posted January 8, 2016 (edited) Hi Fission,you can use:If IsInt($iValue) Then if $iValue > 100 Then _Reset() EndIf Else MsgBox(0,"Not Int","The Value Copied is not recognized as an Int") EndIfgive that a crack and see what it returns for you. Unfortunately it didn't do anything, the message box didn't pop up and the reset function portion didn't activate even though the copied value was > 100 It's probably to do with the following not being validLocal $iValue = Int("{CTRLDOWN}c{CTRLUP}") Edited January 8, 2016 by Fission102 Link to comment Share on other sites More sharing options...
InunoTaishou Posted January 8, 2016 Share Posted January 8, 2016 (edited) The int value of a string is always 0Local $iValue = Int("{CTRLDOWN}c{CTRLUP}")If you don't want to use the IE functions then you'll want to doSend("^{c}") ; Sends Ctrl + C Local $iValue = ClipGet() ; Gets the value copied If ($iValue > 100) Then _Reset() Else MsgBox("", "", "Number is less than or equal to 100") EndIfIt's going to implicitly convert any non number string to 0 and since you're checking to see if it's greater than 100, it doesn't matter if it's a true number or not.(I would give you an IE example but there's plenty in the help file and I've never actually used the IE functions) Edited January 8, 2016 by InunoTaishou Link to comment Share on other sites More sharing options...
Fission102 Posted January 8, 2016 Author Share Posted January 8, 2016 The int value of a string is always 0Local $iValue = Int("{CTRLDOWN}c{CTRLUP}")If you don't want to use the IE functions then you'll want to doSend("^{c}") ; Sends Ctrl + C Local $iValue = ClipGet() ; Gets the value copied If ($iValue > 100) Then _Reset() Else MsgBox("", "", "Number is less than or equal to 100") EndIfIt's going to implicitly convert any non number string to 0 and since you're checking to see if it's greater than 100, it doesn't matter if it's a true number or not.(I would give you an IE example but there's plenty in the help file and I've never actually used the IE functions)Ahh!! ClipGet is what I was misunderstanding then, it will work perfect. I'll also use ^{c} and v instead, seems a lot cleaner.Cheers! 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