0

I have a basic javascript which works within an Action... However I want to control Photoshop from outside the application (in a bigger script/project).

Basic Code

var numberOfPaths = activeDocument.pathItems;  
if (numberOfPaths.length < 1) {  
    'DO SOMETHING HERE - E.g. copy file to folder'
} else {
    'DO SOMETHING ELSE E.g. log and do nothing with it'
}

I am trying to open up an image (one-by-one), and check to see if it has a path, then depending on the If/Else statement, do something with it.

I've searched around and haven't found anything that meets what I am trying to do. I am not familiar with Javascript, more into Python. I've tried to do something like below, targeting photoshop similar to how you would in Applescript. Though I'm at a loss.

...
Photoshop = Application('Adobe Photoshop CC 2014');
var docRef = Photoshop.open ('PATH/TO/FILE');
var numberOfPaths = Photoshop.activeDocument.pathItems; 
...

Any help would be appreciated. Cheers!

sdavis891
  • 101
  • 1
  • 3
  • 10
  • What about using the ExtendScript Toolkit to run your script, wouldn't that be an option ? – DavidDomain Jul 12 '16 at 14:36
  • I've found this similar topic, however I would prefer not to switch between applescript and javascript if possible. http://stackoverflow.com/questions/3846626/is-it-possible-to-execute-jsx-scripts-from-outside-extendscript – sdavis891 Jul 12 '16 at 14:44
  • Found a Sublime Text 2 package, which seems to be promising. [Sublime Text 2 ExtendScript Photoshop package](http://www.davidebarranca.com/2013/05/sublime-text-2-extendscript-photoshop-build-package/) – DavidDomain Jul 12 '16 at 14:51
  • The issue is that I am running this code outside Photoshop/ExtendScript. I would like to integrate the code within another script, exchanging variables between the two. Unless there is another way to look for clipping paths without using Photoshop. – sdavis891 Jul 12 '16 at 16:22

0 Answers0