BridgeTalk with menu item and calling a photoshop script.
I have quite a few scripts that i use to process multiple files. I would like to be able to call them from bridge in order to call selected thumbnails from multiple bridge documents.
I have the basis modified from @DBarranca code but im new to bridgetalk and not certain how the structure works.
How do i call this from a bridge menu item???
How/ where do a reference an external photoshop script that id like to call to run on these open files??
//from Davide Barrancas code
#target photoshop
if (BridgeTalk.isRunning('bridge')) {
var bt = new BridgeTalk();
bt.target = "bridge";
bt.body = "" + getSelectedFilesPath.toString() + "; getSelectedFilesPath();";
bt.onResult = function(response) {
var filesArray = eval(response.body);
for (var i = 0; i < filesArray.length; i++) {
app.open(new File(filesArray[i]))
}
}
bt.onError = function(err) {
alert("Error!\n" + err.body)
}
bt.send(20);
alert("Done")
}
// Bridge function
function getSelectedFilesPath() {
var filesArray = [];
for (var m = 0; m <= app.documents.length - 1; m++){
for (var i = 0; i <= app.documents[m].selections.length - 1; i++) {
if (app.documents[m].selections[i].type == "file") {
filesArray.push(app.documents[m].selections[i].path);
}
}
}
return filesArray.toSource();
}
