Author Topic: Question about read,close,remove fileIO  (Read 254 times)

Can someone tell me how to read file and at the end close it and remove. Becouse if i create one button with something like this:

var test = + "/projectSettings.txt").readAll() + "/projectSettings.txt").close() + "/projectSettings.txt").remove()
i get Script 135 FileIOError: Cant remove file

but if i create two buttons in one i read file on second close and remove then it works.

What is the point of calling three times in a row in your example ? This function returns a file handle.
You should use instead:
Code: [Select]
var test = + "/projectSettings.txt")
var content = test.readAll()
Don't forget your log file. It can be exported from the Help menu of the software.
Fabrice Piquet aka Froyok. Product Manager, Technical Artist and Documentation at Adobe.