Copy link to clipboard
Copied
Sorry for the newbie question. I have a script that creates stacks by capture time for all images in a folder.
I'd like to be able to run it only on the highlighted images. I'm just not sure how to identify a highlighted image in javascript.
Thanks
Copy link to clipboard
Copied
This is from Edit Script Add Pictures eliminated the dialog box
#target photoshop;
alert(GetFilesFromBridge().join('\n'));
function GetFilesFromBridge() {
function script(){
var fL = app.document.selections;
var tF=[];
for(var a in fL){
if(fL.type =='file'){
tF.push(new File(encodeURI(fL.spec.fsName)));
}
}
return tF.toSource();
}
var fileList;
var bt = new BridgeTalk();
bt.target = "bridge";
bt.body = "var ftn = " + script.toSource() + "; ftn();";
bt.onResult = function( inBT ) { fileList = eval( inBT.body ); }
bt.onError = function( inBT ) { fileList = new Array(); }
bt.send(8);
bt.pump();
if ( undefined == fileList ) fileList = new Array();
return fileList;
};