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

Please Help me :( for Bridge Talk

Explorer ,
Mar 27, 2017 Mar 27, 2017

Copy link to clipboard

Copied

var bt = new BridgeTalk();  bt.target = "photoshop";  bt.body ="app.open(new File("+app.selection[0].graphics[0].itemLink.filePath+"));";  bt.onResult = function( inBT ) { result = eval( inBT.body ); }  bt.onError = function( inBT ) {alert(inBT.body); }  bt.send(8);  I want to open selection image

TOPICS
Scripting

Views

853

Translate

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 27, 2017 Mar 27, 2017

Copy link to clipboard

Copied

Hi ahmetö66264486,

does this works for you?

var file2open = app.selection[0].graphics[0].itemLink.filePath;

var bt = new BridgeTalk();

bt.target = "photoshop";

bt.body = "app.open(new File('" + file2open + "'));";

bt.onResult = function( inBT ) { result = eval( inBT.body ); };

bt.onError = function( inBT ) { alert(inBT.body); };

bt.send(8);

Have fun

Votes

Translate

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
Explorer ,
Mar 27, 2017 Mar 27, 2017

Copy link to clipboard

Copied

Many thanks 🙂 was very helpful.

Votes

Translate

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
Explorer ,
Mar 27, 2017 Mar 27, 2017

Copy link to clipboard

Copied

Can I send it in function?

Votes

Translate

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
Explorer ,
Mar 27, 2017 Mar 27, 2017

Copy link to clipboard

Copied

like: bt.body = ofile();

Votes

Translate

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 28, 2017 Mar 28, 2017

Copy link to clipboard

Copied

ahmetö66264486  schrieb

like: bt.body = ofile();

Sure. But in bt.body you always have to work with strings.

var file2open = app.selection[0].graphics[0].itemLink.filePath;

var bt = new BridgeTalk();

bt.target = "photoshop";

bt.body = "openFileInPS = function openFileInPS( file2open ) {    app.open(new File('" + file2open + "'));    };\ropenFileInPS('" + file2open + "');";

bt.onResult = function( inBT ) { result = eval( inBT.body ); };

bt.onError = function( inBT ) { alert(inBT.body); };

bt.send(8);

Have fun

Votes

Translate

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 31, 2017 Mar 31, 2017

Copy link to clipboard

Copied

Hi ahmetö66264486

do you still have problems?

Votes

Translate

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
Explorer ,
Apr 01, 2017 Apr 01, 2017

Copy link to clipboard

Copied

Thank you for your help. But there is one more question. Example: function ahmet(){ //Scripts } bt.body=".+ahmet()+";

Votes

Translate

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 ,
Apr 01, 2017 Apr 01, 2017

Copy link to clipboard

Copied

LATEST

question one: answered

question two: answered

question three:

#target indesign

var bt = new BridgeTalk();

bt.target = "photoshop";

bt.body = "alertInPS = " + alertInPS.toString() + "\ralertInPS();";

bt.onResult = function( inBT ) { result = eval( inBT.body ); };

bt.onError = function( inBT ) { alert(inBT.body); };

bt.send(8);

function alertInPS() {

    alert("Hello PS");

    // do something else

}

also answered

Have fun

Votes

Translate

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