Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Get active document path from Photoshop

New Here ,
Sep 09, 2015 Sep 09, 2015

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!

TOPICS
Scripting
3.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Sep 16, 2015 Sep 16, 2015

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

...
Translate
Community Expert ,
Sep 13, 2015 Sep 13, 2015

Are you setting up bridge talk to communicate with Photoshop via bridge?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 16, 2015 Sep 16, 2015

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;

}

Pedro Marques - Shaping the next era of e-commerce, from polished product images to seamless workflows to AI-generated content.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 16, 2015 Sep 16, 2015
LATEST

Pedro:

Perfect, I had some path bridge stuff from an example I found online, but your example did the trick.   Thanks a bunch!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines