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
Copy link to clipboard
Copied
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:
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"
}
}