After EasyCatalog imports an image, it looks for a script called “PostImageImport.jsx” in both the Data Source->Scripts folder and the EasyCatalog Workspace Folder->Scripts folder. This can be used to manipulate an image after import. The example below applies the DETECT EDGES clipping path setting:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | // Sample script to change the clipping path to detect edges // These can be used to extract the field name and content of the image field: //alert(app.scriptArgs.getValue("field")); //alert(app.scriptArgs.getValue("fieldContent")); // Get the internal ID of the container, passed in from EasyCatalog var myID = Number(app.scriptArgs.getValue("id")); // Get the frame var myFrame = app.activeDocument.pageItems.itemByID(myID) // Get the image var myImage = myFrame.allGraphics[0]; // Set the clipping path myImage.clippingPath.clippingType = ClippingPathType.DETECT_EDGES; // Re-fit the image myFrame.fit(FitOptions.proportionally); |