Highlighted

How to open a graphics images in illustrator via InDesign using javascript

Community Beginner ,
Oct 23, 2020

Copy link to clipboard

Copied

Need to open a graphics images in ilustrator, which that used in indesign

Please share javascript code with explanation its more helpful to understand.

 

Thanks

Balaji

TOPICS
Activation billing and install, Feature request, How to, Import and export, InCopy workflow, Performance, Scripting, SDK, Server developers, Sync and storage, Type

Views

47

Likes

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

How to open a graphics images in illustrator via InDesign using javascript

Community Beginner ,
Oct 23, 2020

Copy link to clipboard

Copied

Need to open a graphics images in ilustrator, which that used in indesign

Please share javascript code with explanation its more helpful to understand.

 

Thanks

Balaji

TOPICS
Activation billing and install, Feature request, How to, Import and export, InCopy workflow, Performance, Scripting, SDK, Server developers, Sync and storage, Type

Views

48

Likes

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
Oct 23, 2020 0
Adobe Community Professional ,
Oct 23, 2020

Copy link to clipboard

Copied

Possible help here:

https://forums.adobe.com/message/10598534#10598534

Mike Witherell

Likes

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
Reply
Loading...
Oct 23, 2020 0
rob day LATEST
Adobe Community Professional ,
Oct 23, 2020

Copy link to clipboard

Copied

You would need to use the BridgeTalk class to open other applications.

http://estk.aenhancers.com/interapplication-communication/communicating-through-messages.html

 

I posted a Photoshop example here:

 

https://community.adobe.com/t5/indesign/indesign-script-for-get-color-name-or-values-of-illustrator-...

 

Here is a similar example for Illustrator. Direct Select a linked AI file and run the script. It sends the link’s file path to Illustrator, opens the linked file and returns a string back to ID:

 

 

 

//InDesign as the script application
#target indesign
#targetengine "session" 

//the file path of a selected placed AI file
var fp = app.activeDocument.selection[0].itemLink.filePath;

runIllustrator(true, "Hey There");


/**
* A BridgeTalk function to run in Illustrator 
*  a boolean example 
*  a string example 
*  void 
* 
*/
function runIllustrator(isBoolean, theString){
    //open Photoshop and run psScript
    var bt = new BridgeTalk();  
    bt.target = "Illustrator";  
    //the function string with a string variable and 2 parameters
    //Note a string parameter is '"+theString+"'
    //Other parameters are "+isBoolean+"
    
    bt.body = "var aString = '"+fp+"'; var func = " + aiScript.toString() + "func("+isBoolean+",'"+theString+"');";

    bt.onResult = function(resObj) { 
        alert("Illustrator returned this message: " + resObj.body);
    }  
    bt.onError = function( inBT ) { alert(inBT.body); };  
    bt.send(8);  
      
    function aiScript(isBoolean, theString) {  
        app.open(File(aString));
        var n = app.documents[0].name
        alert("Illustrator Running. Document named " + n + " is open.")
        
        //the 2 parameters and variable with the file path sent to Illustrator
        $.writeln("1st Param= " + isBoolean); 
        $.writeln("2nd Param= " + theString);
        $.writeln("1st Var= " + aString);
        return "Done"
    }  
}

 

 

Likes

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
Reply
Loading...
Oct 23, 2020 0