I recently wrote jsx to read a list of PSDs from text file then save them as tiffs.
#target photoshop
main();
function main(){
//declare listFile variable, prompt to browse for text file
var listFile = File.openDialog("Open List File","text(*.txt):*.txt;");
//if no file selected, return
if(listFile == null) return;
//read the selected text file (listFile) to a string(listString)
listFile.open('r') ;
var listString = listFile.read();
listFile.close();
//splitting at line breaks, convert into array of strings
fileList = listString.split('
');
//iterate array of strings (filenames), open & save as tiff
for(var i=0; i<=fileList.length; i++){
var theFile =new File(fileList[i]);
app.open(theFile);
saveAsTiff(theFile);
}
};
function saveAsTiff(theFile){
//tiff saving options here
}
once you read the file as a string, the JS function findstring() is probably what you want.
the Adobe documentation assumes you have some general JS competence.
when I first started java scripting, I found thewc3 siteinvaluable.
for Photoshop scripting , ps-scripts.com forumsare helpful.
Where would one fine a list of all PS functions such as File.openDialog()?
neither the photoshop scripting reference or the ps js scripting reference contained this “File.openDialog” and a google search reveals little.