Best4FREE Posted May 3, 2008 Share Posted May 3, 2008 Hi can someone code me a script or tell me example How i can detect How much letters in clipboard? example : now clipboard = ajd3kk if clipboard = 6 letters then msgbox 6letters found Link to comment Share on other sites More sharing options...
MikeP Posted May 3, 2008 Share Posted May 3, 2008 (edited) Hi. ClipPut("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam viverra, nisi vitae hendrerit facilisis, nisl turpis fringilla lectus, a scelerisque nibh turpis vel libero.") MsgBox(0,"","Clipboard contains : " & StringLen(Clipget()) & " characters") Edited May 3, 2008 by MikeP Link to comment Share on other sites More sharing options...
Best4FREE Posted May 3, 2008 Author Share Posted May 3, 2008 THANKS Link to comment Share on other sites More sharing options...
zackrspv Posted May 4, 2008 Share Posted May 4, 2008 (edited) Hi. ClipPut("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam viverra, nisi vitae hendrerit facilisis, nisl turpis fringilla lectus, a scelerisque nibh turpis vel libero.") MsgBox(0,"","Clipboard contains : " & StringLen(Clipget()) & " characters") The only issue w/ this code is that it will count punctuation, spaces, any special charters. The op only wanted to count letters, so all other formatting must be removed This code: $String = ClipGet() $String = StringRegExpReplace($string, "[^a-z|A-Z]","", 0) $string = StringReplace($string, "|", "", 0) $LengthofLetters=StringLen($string) ConsoleWrite("There are: "&$LengthofLetters&" letters in the clipboard"&@crlf&"And they are: "&$string&@CRLF) Should get you a bit closer to what the op wants. Edited May 4, 2008 by zackrspv -_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë. Link to comment Share on other sites More sharing options...
herewasplato Posted May 4, 2008 Share Posted May 4, 2008 ...The op only wanted to count letters,...Or maybe...ClipPut("Something simple like StringStripWS") MsgBox(0, "", "Clipboard contains : " & StringLen(StringStripWS(ClipGet(), 8)) & " characters") [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
herewasplato Posted May 4, 2008 Share Posted May 4, 2008 Or you could look thru this thread:http://www.autoitscript.com/forum/index.ph...st&p=321957 [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
zackrspv Posted May 4, 2008 Share Posted May 4, 2008 Or maybe...ClipPut("Something simple like StringStripWS") MsgBox(0, "", "Clipboard contains : " & StringLen(StringStripWS(ClipGet(), 8)) & " characters") And that's a good method to remove any type of spacing, etc; but it still leaves special characters, numbers, puncuation, etc. Only letters need be returned, hence my use of regular expressions. Or didn't i understand properly? LOL Entirely possible, i'm taking Darvocet for a broken ankle here hahaha -_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë. Link to comment Share on other sites More sharing options...
herewasplato Posted May 4, 2008 Share Posted May 4, 2008 (edited) from OP...now clipboard = ajd3kk if clipboard = 6 letters then...Your code returns 5 letters... you might want to include numbers as letters like the OP did.It looked like a password type of thing. I'm not sure what all the OP wants to count, but some special characters are allowed/encouraged in passwords.You are correct, StringStripWS will not remove the items that you mentioned.I'm too regular of a guy to understand regular expressions :-)Edit: It could be interpreted that the MsgBox would not show in the OP's pseudo code Edited May 4, 2008 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
zackrspv Posted May 4, 2008 Share Posted May 4, 2008 I'm too regular of a guy to understand regular expressions :-)hahahahahaha nice lol -_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë. Link to comment Share on other sites More sharing options...
MikeP Posted May 4, 2008 Share Posted May 4, 2008 The only issue w/ this code is that it will count punctuation, spaces, any special charters. The op only wanted to count letters, so all other formatting must be removedOh, right.. I don't know why I had 'characters' in mind.. My msgbox even states it's counting characters 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