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 ?
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)
}
Copy link to clipboard
Copied
Normally I would say: yes. But please, explain a bit more in detail.
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!
Copy link to clipboard
Copied
Hi,
Try the way mention in the following thread
Copy link to clipboard
Copied
I have already tried without success!
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)
}
Copy link to clipboard
Copied
It works!
Thank you @Charu Rajput