Write a tag to a txt file

Hello, I wonder if is possible to write a line break every time I write to a txt file

with this code I get the following

data = event.source.parent.getComponent('turno1').text filename = system.file.saveFile("MyDownloadedFile.txt") if filename != None: system.file.writeFile(filename, data,1)
[attachment=0]1.png[/attachment]

But I want something like this
[attachment=1]2.png[/attachment]

Sure, just append a newline character to data before you write it…

data = event.source.parent.getComponent('turno1').text + '\n'

Its not working with “notepad” but works with “wordpad”, It is possible to do this with notepad?

notepad:
[attachment=0]notas.png[/attachment]

wordpad:
[attachment=1]wordpad.png[/attachment]

Maybe you need to write a carriage return before the linefeed for notepad to pick it up… use ‘\r\n’ instead.

2 Likes

Thanks Keevin, That worked!