Copy link to clipboard
Copied
I know you can get path of the documet you're working on activeDocument.path, but can you get the path of the script you're running as well?
Copy link to clipboard
Copied
I might not even need to now that I think of it, I'm just trying to target and copy item from photoshop and paste it over in illustrator, here is how I am doing it:
illustrator.executeScript(illustrator.jsx);
photoshop.executeScript (photoshop.jsx);
Copy link to clipboard
Copied
You have to be carefull how you use path and name in a script as they are read only properties of app.
var p = activeDocument.fullName;
alert(p);// alerts full path to doc
var path = activeDocument.fullName;
alert(path);// alerts full path to Photoshopalert($.fileName)// full path to script
Copy link to clipboard
Copied
If you want the path of a running script you could use..
function WhoAmI() {
var where;
try {var F = FO;
}catch( err ) {where = File(err.fileName);}
return where;
}
As for using:- photoshop.executeScript (photoshop.jsx);
This is supposed to do an eval, so it's not executing "photoshop.jsx" it is trying to evaluate it into a command.
I have never seen a working example of executeScript and have never managed to get it to work.
Copy link to clipboard
Copied
Paul,
Is there a reason not to use $.fileName?
And I think that the BridgeTalk wrapper for executeScript in both the illustrator.jsx and photoshop.jsx startup scripts in broken. For example it you run this in ESKT with Photoshop as the target you will get an alert.
photoshop.executeScript ("alert('Hello World');");
But run it again after switching the target to Bridge or Illustrator and you will not get the alert.
Copy link to clipboard
Copied
Your right Mike, I keep thinking of compatibility with CS2 as $.fileName is CS3 or better.
Copy link to clipboard
Copied
$.fileName and err.fileName both return the path to Photoshop directory, instead of script path - when running from CS Extension panel. Is there a way to get the real path to the script?
Thank you!
Copy link to clipboard
Copied
I thought that panels could only be run if they are installed and they are only installed in one place.
new Folder(app.path + '/Plug-Ins/Panels/yourPanelName.jsx');
// or if you has AEM install into a folder
new Folder(app.path + '/Plug-Ins/Panels/yourInstallFolder/yourPanelName.jsx');
Copy link to clipboard
Copied
Thanx, but it doesn't work - in CS5 panels are being installed in a different place. Actually several different places.
![]()
Copy link to clipboard
Copied
Are you talking about the new CSIDE panels? What does Folder.startup return for you?
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more