andrew.arnott Posted October 21, 2005 Posted October 21, 2005 Okay, here is my issue. I'm trying to use StringReplace (to get rid of some newline characters and tabs from an entry in the clipboard), but when I use ClipGet() and then StringReplace, it won''t replace anything. HotKeySet("^+d", "CreateGetterSetter") #Include <string.au3> While 1 Sleep(0x7FFFFFFF) WEnd Func CreateGetterSetter() Send("{CTRLDOWN}c{CTRLUP}") $text = ClipGet() StringReplace($text,@CRLF," ") StringReplace($text,@LF," ") StringReplace($text,@CR," ") StringReplace($text,@TAB,"") MsgBox(0, "New string is", $text) EndFunc Any ideas as to why this is happening?
Valuater Posted October 21, 2005 Posted October 21, 2005 (edited) i am really not sure... but try this HotKeySet("^+d", "CreateGetterSetter") #Include <string.au3> While 1 Sleep(0x7FFFFFFF) WEnd Func CreateGetterSetter() Send("{CTRLDOWN}c{CTRLUP}") $text = ClipGet() $text = StringReplace($text,Chr(13)," ") $text = StringReplace($text,Chr(10)," ") ;StringReplace($text,Chr(13)," ") $text = StringReplace($text,Chr(9),"") MsgBox(0, "New string is", $text) EndFunc 8) OOOPS.. edit dumb mistakes Edited October 21, 2005 by Valuater
Developers Jos Posted October 21, 2005 Developers Posted October 21, 2005 $text = StringReplace($text,@CRLF," ") etc.... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
andrew.arnott Posted October 21, 2005 Author Posted October 21, 2005 Thx for the quick replies! Hmmm -- still won't work. Perhaps it has to do with HotKeySet, since if I don't use a hotkey to call the function, it replaces the clipboard text no problem. Is this a bug?
Developers Jos Posted October 21, 2005 Developers Posted October 21, 2005 Thx for the quick replies! Hmmm -- still won't work. Perhaps it has to do with HotKeySet, since if I don't use a hotkey to call the function, it replaces the clipboard text no problem.Is this a bug?Should work... can you show your updated code ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
andrew.arnott Posted October 21, 2005 Author Posted October 21, 2005 lol -- oops didn't notice your post jdeBThanks a lot it works now! Soon my setter/getter function will work http://www.autoitscript.com/forum/index.php?showtopic=17160Spending time to code stuff to use to be a lazy coder is fun
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