Yes! Wanna know how?
Okay, okay. One way is to make an action that opens the script and run that from File>Automate>Batch.
Actually, in this case that doesn’t work. The first file name gets thrown on all the files. There must be a way to script it within the script. Does any one know how to code it?
Perhaps if you explained with a few more details, what you’re trying to do?
Chad,
Worked perfectly for me. What steps are you taking in what order? My action was very simple; one step only, consisting of running the script.
The script I am using is AddFileName, which I downloaded from the AdobeExchange, It goes like this(with comments):
// this script is a variation of the script addTimeStamp.js that is installed with PH7
if ( documents.length > 0 )
{
var originalRulerUnits = preferences.rulerUnits;
preferences.rulerUnits = Units.PIXELS;
try
{
var docRef = activeDocument;
// Now create a text layer at the front
var myLayerRef = docRef.artLayers.add();
myLayerRef.kind = LayerKind.TEXT;
myLayerRef.name = "Name";
var myTextRef = myLayerRef.textItem;
myTextRef.contents = docRef.name;
// off set the text to be in the top left corner
myTextRef.position = new Array( 12, 20 );
}
catch( e )
{
// An error occurred. Restore ruler units, then propagate the error back // to the user
preferences.rulerUnits = originalRulerUnits;
throw e;
}
// Everything went Ok. Restore ruler units
preferences.rulerUnits = originalRulerUnits;
}
else
{
alert( "You must have a document open to add the filename!" ); }