Skip to main content
4everJang
Legend
Jun 11, 2020 10:03 AM UTC
Answered

ExtendScript: adding a newline to console messages

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

Ian Proudfoot
Ian ProudfootCorrect answer
Legend
Jun 11, 2020 10:58 AM UTC

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

5 replies

4everJang
4everJangAuthor
Legend
Jun 11, 2020 2:42 PM UTC

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

Translate
Klaus Göbel
Legend
Jun 11, 2020 10:16 AM UTC

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

Translate
Ian Proudfoot
Ian ProudfootCorrect answer
Legend
Jun 11, 2020 10:58 AM UTC

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

Translate