Copy link to clipboard
Copied
This works in Photoshop and Bridge script (Javascript)
var myPath = activeDocument.name;
//Tester.PSD
this only works in Photoshop script (JavaScript), but not in Bridge.
var ProcessFolder = activeDocument.path
//actually stops the script... with no error or warning.
How can I get the file's path of the active document in Photoshop through Bridge?
Thanks!
Hi
You can use BridgeTalk to communicate between apps
In this case, there is the code and you should run it from Bridge to get the information you need from photoshop:
...// run this from Bridge to get the path of the active document
// if photoshop is not running, it gives that message
// if photoshop is Busy, it gives that warning
// if photoshop has any images opened, it avoids getting the path and warn you
pathFromPS();
function pathFromPS() {
var bt = new BridgeTalk;
bt.target = "photo
Copy link to clipboard
Copied
Are you setting up bridge talk to communicate with Photoshop via bridge?
Copy link to clipboard
Copied
Hi
You can use BridgeTalk to communicate between apps
In this case, there is the code and you should run it from Bridge to get the information you need from photoshop:
// run this from Bridge to get the path of the active document
// if photoshop is not running, it gives that message
// if photoshop is Busy, it gives that warning
// if photoshop has any images opened, it avoids getting the path and warn you
pathFromPS();
function pathFromPS() {
var bt = new BridgeTalk;
bt.target = "photoshop";
bt.body = '(app.documents.length > 0) ? app.activeDocument.path : "No active images";';
bt.onResult = function (resObj) {
activePath = resObj.body;
}
if (BridgeTalk.getStatus (bt.target) == 'IDLE') {
bt.send(3);
} else {
activePath = (BridgeTalk.isRunning(bt.target)) ? "[Busy]" : "[Not Running]";
}
return activePath;
}
Copy link to clipboard
Copied
Pedro:
Perfect, I had some path bridge stuff from an example I found online, but your example did the trick. Thanks a bunch!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more