Reply To: Apply Multiply Effect and Clipping Path then Group images.

#85203
Ari Singer
Member

Here you go. This is the updated script that removes the clipping path from the bottom object:

//Ari S. - designerjoe@outlook.com
app.scriptPreferences.enableRedraw = false;
// 'Undo' will undo the entire script
app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Image Manipulation Script");

function main(){
    // Capture the current selections in array
    var mySelections = app.selection;
    for (var i = 0; i < mySelections.length; i++) {
        try{
            var bottomObject = mySelections[i];
            var topObject = bottomObject.duplicate();
            bottomObject.transparencySettings.blendingSettings.blendMode = BlendMode.MULTIPLY;
            try {
                topObject.pageItems.item(0).clippingPath.appliedPathName = topObject.pageItems.item(0).clippingPath.photoshopPathNames[0];
                topObject.pageItems.item(0).clippingPath.clippingType = ClippingPathType.PHOTOSHOP_PATH;
                bottomObject.pageItems.item(0).clippingPath.clippingType = ClippingPathType.NONE;
                try {
                    var myGroup = bottomObject.parent.groups.add ([bottomObject, topObject]);
                    app.select(myGroup);
                    }
                catch (myError) {
                    // If it can't group
                    alert("could not group successfully");
                    }
                }
            catch (myError) {
                // If it can't apply the Photoshop path then it obviously does not have one
                alert("Selected image does not have a Photoshop path applied")
                }
            }
        catch (myError){
            // If it can't duplicate the object or apply multiply then it's obviously not a graphic frame
            alert("Make sure you selected a graphic frame");
            }
        }
    }

Only one line was added:
bottomObject.pageItems.item(0).clippingPath.clippingType = ClippingPathType.NONE;

This article was last modified on May 25, 2016

Comments (0)

Loading comments...