Guy_ Posted January 1, 2013 Posted January 1, 2013 $prefix = @CRLF & $article_Prefix I have this spot where I define a prefix. The @CRLF should function as a Shift+Enter (to stay inside a paragraph in WordPad etc.). Using Send ("+{ENTER}") works correctly, but I can't use that here, can I? In the code neither @CRLF, @LF or @CR is doing the job. Do I have to use the Chr ( ASCIIcode ) for this? (but I don't see a code that could be it...) Tyvm & Happy Newyear!
czardas Posted January 1, 2013 Posted January 1, 2013 (edited) I'm not sure what you mean by stay inside a paragraph, Control + Enter seems to do something. If you are looking for an indent, perhaps @TAB will work.CODE REMOVEDI'm just guessing though. What's wrong with using two Send commands one after the other?EditI think I'm missing something here. When I format a paragraph in Wordpad, @CTRL @CRLF doesn't alter the indent. Using Shift + Enter doesn't seem to do anything special or different from just pressing Enter. What I said above must be wrong. Edited January 2, 2013 by czardas operator64 ArrayWorkshop
Guy_ Posted January 2, 2013 Author Posted January 2, 2013 (edited) It's common in a lot of programs that Shift + Enter has you remain in the same paragraph. In other words, it doesn't truely create a new one, it just puts the cursor to the next line. Often people have paragraph styles defined where e.g. space would be added between them, font changes, etc. You don't want that when you just want some text in the current parapgraph starting on the next line. With Shift + Enter, you will remain in the current paragraph (formatting). In my program, at that point I'm in an "internal code" situation where I think I can't use the Send command. I'm concatenating some stuff where I want the Shift + Enter effect to be integrated into the variable. Is this more clear? I sure hope it exists. These kind of questions never seem to get much response. Edited January 2, 2013 by Guy_
czardas Posted January 2, 2013 Posted January 2, 2013 (edited) Well if it's intended to be universal for programs other than WordPad then there is no guarantee that the character string will be formatted the same way. What you are doing is sending an accelerator key to a GUI which may behave differently depending on the program. I think probably the best option is to do what I suggested earlier and send each line with two commands. First send the accelerator keys and then the line of text. If you need to do this multiple times, you could try using an array to store each line separately. Another complication with trying to embed certain formatting instructions within strings is that they may be stored in a separate location to the actual text in some formats such as RTF. Edited January 2, 2013 by czardas operator64 ArrayWorkshop
Guy_ Posted January 2, 2013 Author Posted January 2, 2013 Well if it's intended to be universal for programs other than WordPadActually on the contrary. If it would work with WordPad only, I'd still be happy (and it probably would for Word too).I think probably the best option is to do what I suggested earlier and send each line with two commands. First send the accelerator keys and then the line of text.Accelerator keys is the Send("+{ENTER}") ...?BTW, you mention @CTRL in your first message, which I never mentioned. Was that a spelling error or a useful hint? Another complication with trying to embed certain formatting instructions within strings is that they may be stored in a separate location to the actual text in some formats such as RTF.True, that may be the core problem...I'll have to find a workaround where I replace a certain dummy code combo with the Send("+{ENTER}") during pasting, I guess...It will then make it more universal as well.Thanks for your help!
czardas Posted January 2, 2013 Posted January 2, 2013 (edited) Accelerator keys is the Send("+{ENTER}") ...?Yes@CRLF is a macro used in AutoIt to insert both CR and LF in sequence. Many programs use this combination for line breaks. You could write the whole file in Rich Text Format, but that would mean learning some complicated syntax and it could take you much longer to complete your project, although it might be more suitable and better in the long run. Personally I would experiment with possible the workaround solutions.Thanks for your help! I'm a bit out of my depth when it comes to RTF, but if something I said helps you then I'm happy about that. Thanks! Edited January 2, 2013 by czardas operator64 ArrayWorkshop
czardas Posted January 2, 2013 Posted January 2, 2013 BTW, you mention @CTRL in your first message, which I never mentioned. Was that a spelling error or a useful hint? Oops, that was a mistake. I was a bit tired last night. lol operator64 ArrayWorkshop
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