Photoshop Script - Working with external text files

Hi all,

I’m writing a Photoshop script that runs through a folder of about 500 textures and checks if they have a transparent background. If they do then a copy is saved in a separate folder. I’m also trying to save the file name to a text file.

I should probably say that the script is attached to a droplet and is used by dragging a folder onto it to run the script on each of the images in the folder.

A break down of the script:
Checks different sections of the image for transparency.
If its transparent then saves a copy of the image in a different folder.
Opens a text file and adds the document name to the end of the file (i.e on a new line below the last line).

I need to know how to go to the end of file so that I can add the next file name to it.
E.G
If the text file already contains:
texture1
texture2

and I want to add texture3 at the end so it becomes:
texture1
texture2
texture3

how would I do this?

Any help would be much appreciated.