PDA

View Full Version : Photoshop Script - Working with external text files



VeddyCent
June 28th, 2011, 11:05 AM
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.

VeddyCent
June 28th, 2011, 11:34 AM
Never mind. I figure it out.
For those that want to know how, here it is:

fileOut= File(address of file you want to use.txt);

fileOut.open("e");
fileOut.seek(0,2);
fileOut.writeln("Text here");

Peace

mlk
July 6th, 2011, 09:19 AM
For more help on scripting visit www.ps-scripts.com/bb/. The tutorial on this website is really old, outdated but somehow still gets traffic.