Skip to main content
4everJang
Legend
June 11, 2020
Answered

ExtendScript: adding a newline to console messages

  • June 11, 2020
  • 2 replies
  • 1675 views

Hello fellow scripters,

I have been using Err( 'some text' ) to push messages into the console, but I have failed to find the way to add newlines to those messages. If anyone has done that, please enlighten me on this detail.

Thanks

4everJang

Correct answer Ian Proudfoot

I normally add  '\r' at the start of a new Console() message. If you don't do that your message my get added to the end of anything that's already there. 

 

Ian

2 replies

4everJang
4everJangAuthor
Legend
June 11, 2020

Klaus and Ian,

Thanks for the info. Strange - the whole world is using \n but Frame decided to go with \r - a blast from the distant past, when the mechanical typewriter did not insert a newline but alo needed a carriage return. I bet most youngsters do not even know what a carriage return means - taking the rental car back to the airport, perhaps? 🙂

Ciao

Klaus Göbel
Legend
June 11, 2020

Hello Jang,

it's a funny thing:

You could use:

Err( 'some text\n' )

or

Err( 'some text\n' )

In both cases a new line is insertet in consfile.txt, but is NOT shownin the FrameMaker console

If you use

Console("some text\r")

or

Console("some text\n")

it works in both, consfile and console

Ian Proudfoot
Ian ProudfootCorrect answer
Legend
June 11, 2020

I normally add  '\r' at the start of a new Console() message. If you don't do that your message my get added to the end of anything that's already there. 

 

Ian