catalog task description line breaks in script

randrews
Tera Guru

if you are using an advanced script in a catalog task.. how do you insert a line break?

for example

task.description = 'This is line one';
task.description = task.description + 'what code goes here' + 'This is line two';

1 ACCEPTED SOLUTION

Your slash in front of the n is the wrong way. It needs to be \n


View solution in original post

8 REPLIES 8

Aaron40
Kilo Guru

Hi.

You include \n in your script

ie:



task.description = task.description + '\n' + 'This is line two';


Aaron40
Kilo Guru

Though all of that can be written as one line.



task.description = var1 + '\n' + var2;


Or you don't even need to break them apart if you're using one long string. If you're using two variables, you need to use the example above. If you're using one large string that you want broken into two pieces, you don't need to overcomplicate it.



task.description = 'data for line 1 here\ndata for line 2';


randrews
Tera Guru

/n isn't working and as written it runs it all into a run on block.. which since each line is a separate step isn't a good idea

when i put

task.description = task.description + '/n' + 'This is line two';

i get "line 1 /n line2"

as one long description not on lines inside of the description block


Your slash in front of the n is the wrong way. It needs to be \n