Skip to main content
SparrowInkDesign
Participating Frequently
May 30, 2023
Answered

Script to apply clipping path-detect edges to selected image

  • May 30, 2023
  • 1 reply
  • 641 views

I'm looking for a simple script to apply clipping path>detect edges to whatever image is selected. I'm a bit new to scripting, any ideas?

This topic has been closed for replies.
Correct answer brian_p_dts

Something like this: 

try {
    var sel = app.selection[0];
    if (sel.graphics.length) {
        sel.graphics[0].clippingPath.clippingType = ClippingPathType.DETECT_EDGES;
    }
    else {
        sel.clippingPath.clippingType = ClippingPathType.DETECT_EDGES;
    }
} catch(e) {
    //alert(e);
}

1 reply

brian_p_dts
Community Expert
brian_p_dtsCommunity ExpertCorrect answer
Community Expert
May 30, 2023

Something like this: 

try {
    var sel = app.selection[0];
    if (sel.graphics.length) {
        sel.graphics[0].clippingPath.clippingType = ClippingPathType.DETECT_EDGES;
    }
    else {
        sel.clippingPath.clippingType = ClippingPathType.DETECT_EDGES;
    }
} catch(e) {
    //alert(e);
}
SparrowInkDesign
Participating Frequently
May 30, 2023

This worked flawlessly, thank you so much!