Copy link to clipboard
Copied
I am creating a text file that will tally information from a UI. My hope is that I can add information as buttons are clicked. But when I write to the text file it over writes what is already there.
myFile.writeln("\r\n",mySFolder," ",myCountText.text, );
I am wondering how to append to the text file.
Here is an example...
var Log =File(Folder.desktop +"/LogFile.txt");
Log.open('w'); //open a new document
Log.writeln("This is a log file");
Log.close();Log.open('e'); //open for append
Log.seek(0,2); //seek to end of file
Log.writeln("Write text to re-opened file");
Log.close();
Copy link to clipboard
Copied
Here is an example...
var Log =File(Folder.desktop +"/LogFile.txt");
Log.open('w'); //open a new document
Log.writeln("This is a log file");
Log.close();Log.open('e'); //open for append
Log.seek(0,2); //seek to end of file
Log.writeln("Write text to re-opened file");
Log.close();
Copy link to clipboard
Copied
Paul e is edit… a is append… Your version however works pre-cs4 versions…
Copy link to clipboard
Copied
Thanks Mark, like me it's OLD
Copy link to clipboard
Copied
When I used 'a' it did not work. I am using CS5 Bridge.
Copy link to clipboard
Copied
This works with Windows 7 and Bridge CS5.
var Log =File(Folder.desktop +"/LogFile.txt");
Log.open('w'); //open a new document
Log.writeln("This is a log file");
Log.close();Log.open('a'); //open for append
Log.writeln("Write text to re-opened file");
Log.close();
Copy link to clipboard
Copied
I am using OS 10.6.8. 'e' works for me. I am wondering if I will have any trouble when I switch to Windows 7?
Copy link to clipboard
Copied
Thank you very much for your help!!