PHOTOSHOP CC 2015 - Try/catch scripting issue: Warning dialog windows are thrown on selection errors.

  • 2
  • Problem
  • Updated 3 years ago
  • (Edited)
Photoshop CC 2015 will throw a warning dialog when running JavaScript that contains a try/catch block. The try/catch block contains code that attempts to manipulate a selection. With previous versions of Photoshop the error would be caught and the warning dialog would be suppressed.

In the code below, if a path does not exist the error is caught and the error is suppressed. In the second section, an error window is thrown.

try{
activeDocument.pathItems[0].makeSelection(.7, true, SelectionType.REPLACE);
}catch(e){}

try{
activeDocument.selection.selectBorder(1);
}catch(e){}

Is this an intentional change for 2015 or a bug?
Thanks.
Photo of recline

recline

  • 1 Post
  • 0 Reply Likes

Posted 3 years ago

  • 2
Photo of Colin Germain

Colin Germain

  • 1 Post
  • 0 Reply Likes
I am having a similar problem. A script that worked fine in many previous versions of CS/CC is now giving me issues in CC 2015. I am looping over many images to stack, and the 50% pixel selection warning is popping up on certain stacks of images, but CC 2015 has no way to suppress the warning and continue with the loop.

Help me Adobe-Won Kenobi, you're my only hope!