Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

new line / break line



  • Please log in to reply
20 replies to this topic
im new hto ahk
  • Guests
  • Last active:
  • Joined: --
hi, im a new ahk coder. I love ahk's simplicity!


I have a question:
How do you make a new line / break line?

I was using FileAppend, and wanted the text to break into several lines.

royboy
  • Guests
  • Last active:
  • Joined: --
`r

is a return

im new here
  • Guests
  • Last active:
  • Joined: --

`r

is a return


didn't work :|

lilalurl.T32
  • Members
  • 391 posts
  • Last active: Jul 05 2011 03:39 PM
  • Joined: 17 May 2007
Have you tried `n (linefeed)?
________
Essential Vaaapp Vaporizer

sosaited
  • Members
  • 278 posts
  • Last active: Oct 06 2009 06:08 PM
  • Joined: 24 Feb 2005
Example script:

FileAppend, First Line`nSecond Line`nThird Line`nFourth Line, Sample.txt
Run, Sample.txt

My small "thanks" to AHK in shape of these dedicated 3d images
Posted Image

garry
  • Spam Officer
  • 3219 posts
  • Last active: Sep 20 2018 02:47 PM
  • Joined: 19 Apr 2005
usually use `r `n ( ASCII 13 and 10 )

im new to ahk
  • Guests
  • Last active:
  • Joined: --
i tried 'r and 'n, but it didn't make any files.

jethrow
  • Moderators
  • 2854 posts
  • Last active: May 17 2017 01:57 AM
  • Joined: 24 May 2009

Example script:

FileAppend, First Line`nSecond Line`nThird Line`nFourth Line, Sample.txt
Run, Sample.txt


i tried 'r and 'n, but it didn't make any files.


Try putting SetWorkingDir %A_ScriptDir% in sosaited's example, at the top of the script. Also, 'n and `n are not the same thing. :wink:

im new to ahk
  • Guests
  • Last active:
  • Joined: --

Example script:

FileAppend, First Line`nSecond Line`nThird Line`nFourth Line, Sample.txt
Run, Sample.txt


i tried 'r and 'n, but it didn't make any files.


Try putting SetWorkingDir %A_ScriptDir% in sosaited's example, at the top of the script. Also, 'n and `n are not the same thing. :wink:


Thanks for the tips, but still didn't work :|

jethrow
  • Moderators
  • 2854 posts
  • Last active: May 17 2017 01:57 AM
  • Joined: 24 May 2009
Try this:
MsgBox, First Line`nSecond Line`nThird Line`nFourth Line
Does that display a Message Box with 4 lines? If so, that answers the op.

purloinedheart
  • Members
  • 538 posts
  • Last active: Sep 22 2014 09:35 PM
  • Joined: 04 Apr 2008

i tried 'r and 'n, but it didn't make any files.


` =/= '

Xanox
  • Guests
  • Last active:
  • Joined: --
I must be overlooking something very simple, but i try to add a line to the top of the file.

Would be great if someone could tell me how to do that.

  • Guests
  • Last active:
  • Joined: --
Because there is a problem with autohotkey.net at the moment you can't download the TF library but try again tomorrow via this link <!-- m -->viewtopic.php?t=46195<!-- l -->

  • Guests
  • Last active:
  • Joined: --
Are you using the single quote ' or the tick `? You want the tick mark, which is shared with the tilda key in the upper left corner of my keyboard.

Tonedef
  • Members
  • 1 posts
  • Last active: Oct 11 2012 10:14 PM
  • Joined: 11 Oct 2012
Another thing to keep in mind is that, depending on the application you're inserting the text into, if you want to insert multiple lines you may need to put a space in between `r`n and the next `r`n, so they don't get wrapped up into one newline:

MsgBox, Line1`r`n `r`nLine 3