Photoshop - Script returned Error : %1

Post Reply
ERodgers
Newbie
Posts: 6
Joined: Fri Feb 17, 2017 7:17 pm

Photoshop - Script returned Error : %1

Post by ERodgers » Thu Aug 24, 2017 11:47 pm

Hey all, firstly I want to say thanks to everyone that has responded to my posts and has helped a brotha out. It is greatly appreciated.

So I'm working on a script that will take a customer's file and merge and delete layers and then crop them. I've written some conditions that will put layers where they need to be and such if the customer has decided to go rogue and place layers wherever they see fit. The problem is there are endless layer combinations to account for so when placed in Switch, those files break the flow or don't reach their destination. Now I've added a try catch block that will run the function in the try block and then if it errors, should put those files in the problem folder. After implementing the try/catch, I've reached a strange error - Script returned Error: %1. So instead of the problem files going through the flow, it just sits in the input folder. Here is what my try/catch looks like:

Code: Select all

if($error == null) {
    try {
        if (docRef.layerSets.length > 1) {
            mergeAndCrop ();
        }
    }
    catch(e)
    {
        $error = e.description;
        $status = failJob;
        $doc.close(SaveOptions.DONOTSAVECHANGES);
    }
}
Can anyone assess what I'm doing wrong? Thanks!

Ed

Post Reply