232showtime Posted November 18, 2014 Share Posted November 18, 2014 is there a function or command in autoit that can detect how many characters I paste to clipboard? because I have 31 characters to getdata in clipboard and sometimes I have 30 characters to getdata in clipboard. Func Copy() If WinActivate("[CLASS:XLMAIN]") Then ;copy from excel Send("^c") Sleep("100") Send("{DOWN}") If WinActivate("[CLASS:CabinetWClass]") Then ControlClick("[CLASS:CabinetWClass]", "", "[CLASS:DirectUIHWND;INSTANCE:1]") Sleep("100") If ControlSend("[CLASS:CabinetWClass]", "", "[CLASS:DirectUIHWND;INSTANCE:1]", "^v") Then;paste to active cabinetclass Local $iResult = _ClipBoard_GetData($CF_TEXT) $fResult = StringLeft($iResult, 31) ControlSetText("[CLASS:TFrmMain]", "", "[CLASS:TEdit; INSTANCE:1]", $fResult) EndIf EndIf EndIf EndFunc ;==>Copy ill get to that... i still need to learn and understand a lot of codes Correct answer, learn to walk before you take on that marathon. Link to comment Share on other sites More sharing options...
jguinch Posted November 18, 2014 Share Posted November 18, 2014 Something like this : StringLen (ClipGet() ) 232showtime 1 Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
SorryButImaNewbie Posted November 18, 2014 Share Posted November 18, 2014 Bit less (I mean more, much more less) elegant solution can be that you simply write the clipboard to a MsgBox, read and check the string there and then kill the MsgBox Link to comment Share on other sites More sharing options...
232showtime Posted November 18, 2014 Author Share Posted November 18, 2014 (edited) Something like this : StringLen (ClipGet() ) yes but, excluding the whitespaces, without whitespace.. Edited November 18, 2014 by 232showtime ill get to that... i still need to learn and understand a lot of codes Correct answer, learn to walk before you take on that marathon. Link to comment Share on other sites More sharing options...
Solution TheSaint Posted November 18, 2014 Solution Share Posted November 18, 2014 (edited) StringStripWS Feed the result into StringLen Edited November 18, 2014 by TheSaint 232showtime 1 Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
232showtime Posted November 18, 2014 Author Share Posted November 18, 2014 (edited) thanks.. #include <MsgBoxConstants.au3> #include <StringConstants.au3> Local $sString = StringStripWS("1 2 3 4 5.", 8) $iLength = StringLen($sString) MsgBox($MB_SYSTEMMODAL, "", "The length of this string is " & $iLength & " characters.") Edited November 18, 2014 by 232showtime TheSaint 1 ill get to that... i still need to learn and understand a lot of codes Correct answer, learn to walk before you take on that marathon. 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