0Ethan0 Posted April 25, 2012 Posted April 25, 2012 Hello fellow AutoIt users The short story of what I'm trying to achieve is this: $SomeVariable = "some text with @CRLF so when I copy it to the clipboard it will create a new line while pasting" ClipPut($SomeVariable) WinActivate("Whatever Notepad WIndow") WinWaitActive("Whatever Notepad WIndow") Send{"^v"} So I'm trying to find a way to mkae AutoIt understand that a @CRLF character in the variable is a line break. Is there a way to send a line break via a variable? Thanks for any input! Cheers and happy AutoIt-ing !
AdmiralAlkex Posted April 25, 2012 Posted April 25, 2012 Easy way is to don't make it part of the text to begin with: "some text with " & @CRLF & " so when I copy " .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
0Ethan0 Posted April 25, 2012 Author Posted April 25, 2012 (edited) Thanks for the answer AdmiralAlkex but the thing is that the text in the variable is a result from some text extraction function (from HTML code) and there's sometime one <div> tag there that I wish to make as a new line. I know I can do it by manipulating the string/ breaking it into two and than doing what you suggested but was just wondering if there is a way to use ClipPut("@CRLF") or some other wayt so when pasting it'll create a new line; just like when I copy text with line breaks in windows I get line breaks when I paste it. This entire thing lead me to wonder how to pass TAB and other instances of this sort using ClipPut and pasting - if it's doable at all. Edited October 23, 2017 by 0Ethan0
Zedna Posted April 25, 2012 Posted April 25, 2012 (edited) $SomeVariable = "some text with @CRLF so when I copy it to the clipboard it will create a new line while pasting" $SomeVariable = StringReplace($SomeVariable, '@CRLF', Chr(13) & Chr(10)) ClipPut($SomeVariable) WinActivate("Whatever Notepad WIndow") WinWaitActive("Whatever Notepad WIndow") Send{"^v"}EDIT: Don't use bold text this way!! Edited April 25, 2012 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
0Ethan0 Posted April 25, 2012 Author Posted April 25, 2012 Thanks Zedna - it works! I'm terribly sorry about the bolded text (not sure how it happened, probably when I pasted something), I'll make sure it won't happen again. Thanks again!
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