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

BridgeTalk , passing Illustrator variable to Photoshop

Engaged ,
Mar 17, 2022 Mar 17, 2022

Copy link to clipboard

Copied

I need some help here...

From an Illustrator script, I want to pass  app.activeDocument.path, and use it at another Photoshop  script

It is possible ?

 

TOPICS
Scripting

Views

470
Translate

Report

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

Community Expert , Mar 17, 2022 Mar 17, 2022

Try following

function main() {
    var myDoc = app.activeDocument;
    var _path = myDoc.path
    var bt = new BridgeTalk();
    bt.target = "Photoshop";
    var myScript = phScript.toString() + "\r";
    myScript += "phScript(\"" + _path + "\")";
    bt.body = myScript;
    bt.send();
}

main()

function phScript(path) {
    alert("Active document path of Illustartor document : " + path)
}  

Votes

Translate
Adobe
Community Expert ,
Mar 17, 2022 Mar 17, 2022

Copy link to clipboard

Copied

Normally I would say: yes. But please, explain a bit more in detail.

Votes

Translate

Report

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
Engaged ,
Mar 17, 2022 Mar 17, 2022

Copy link to clipboard

Copied

Hi, I will try to explain

At photoshop, via scripts I prepare mockups from the active document, and export them at original photoshop document folder

// Make mockups script, set doc path at original photoshop document, as enviroment variable for later use

$.setenv("myFolder_doc_env" ,app.activeDocument.path);

// Export script, use the enviroment variable

var myFolder_doc = $.getenv("myFolder_doc_env")

Some documents are vectors, with this  script I import illustrator document to photoshop

#target Illustrator
var newPathAndname =app.activeDocument.path+"/"+app.activeDocument.name;
var psfile = new File(newPathAndname);
if (psfile.exists) { photoshop.open(psfile); }
else { alert('file does not exist');}

For exporting the mockup from photoshop,   i need  "myFolder_doc" variable, to be the original illustrator document  path
I hope it is clear now!

 

Votes

Translate

Report

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
Community Expert ,
Mar 17, 2022 Mar 17, 2022

Copy link to clipboard

Copied

Votes

Translate

Report

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
Engaged ,
Mar 17, 2022 Mar 17, 2022

Copy link to clipboard

Copied

I have already tried without success!

Votes

Translate

Report

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
Community Expert ,
Mar 17, 2022 Mar 17, 2022

Copy link to clipboard

Copied

Try following

function main() {
    var myDoc = app.activeDocument;
    var _path = myDoc.path
    var bt = new BridgeTalk();
    bt.target = "Photoshop";
    var myScript = phScript.toString() + "\r";
    myScript += "phScript(\"" + _path + "\")";
    bt.body = myScript;
    bt.send();
}

main()

function phScript(path) {
    alert("Active document path of Illustartor document : " + path)
}  
Best regards

Votes

Translate

Report

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
Engaged ,
Mar 17, 2022 Mar 17, 2022

Copy link to clipboard

Copied

LATEST

It works!

Thank you  @Charu Rajput

Votes

Translate

Report

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