Files in File

Friends, I have the following script:
:local a (“court”);
:local data1 (" at: " elaborate script
by: FRANK MU/OZ") ;
/file print file=$a
/file set $a contents=$data1;


and I want it to save a .TXT file to file.

Thank you for your answers.

EL DONCITO.

this is invalid:
:local data1 (" at: " elaborate script
by: FRANK MU/OZ") ;

elaborate script ???


also put the script inside code blocks

What mean:
“and I want it to save a .TXT file to file” ???


At the end of this:

{
:local a "court"
:local data1 "do not write random text and call it script"
/file
print file="$a"
set $a contents=$data1
}

the file court.txt is created.


And for do something better, if the file must persist on reboot, this create the file inside flash disk on Flash devices without modifing the script when used on NAND devices.

{
:local a "court"
:if ([:len [/file find where name="flash" and type="disk"]]=1) do={:set a "flash/$a"}
:local data1 "do not write random text and call it script"
/file
print file="$a"
set $a contents=$data1
}

Very grateful for your answer friend, now how do I place the script as you have it here, shaded in blue, I don't know much about the forum

EL DONCITO.

Select a text and click on icon

Select a text and click on icon

:local a ("court");
:local data1 (" at: " elaborate script
by: FRANK MU/OZ") ;
/file print file=$a
/file set $a contents=$data1;

Very grateful friend


EL DONCITO.