Reset multiple images' clipping paths to "None"

In InDesign CS4, is there a way to check all images at once and reset their clipping paths to "none?" I work on catalogs that have several thousand photos (tif, Photoshop, and a few jpg files) in each one. We break the catalogs into approximately 10 sections/documents then organize them into a book file/palette, so there are only a few hundred images in each section/document. Originally a clipping path was applied to the photos (either a Photoshop clipping path or a "detect edges" path), but we now save them with transparency, so I'd like to be able to turn them all of at once (especially the "detect edges" paths).
Any suggestions? I know basically nothing about scripting, so writing a script wouldn't work in this case.
I appreciate any help...
Thanks,
Lloyd

I'm not sure.
Isn't it a collection up to this:
docs[l].rectangles.everyItem().images.everyItem()
from this point it's got a length:
docs[l].rectangles.everyItem().images.everyItem().clippingPath
So this works here:
#target indesign
function main() {
          var docs = app.documents.everyItem().getElements(),
                    l = docs.length;
          while(l--) {
                    try {
                            cPaths =  docs[l].rectangles.everyItem().images.everyItem().clippingPath;
                            pl = cPaths.length;
                            while(pl--){
                                cPaths[pl].clippingType = ClippingPathType.NONE;
                    } catch(e) {
                              alert(e);
                    alert('All done! You can go outside and play now!')
app.doScript('main()', undefined, undefined, UndoModes.entireScript, 'Reset Clipping');
Have a nice day
Hans-gerd Claßen

Similar Messages

  • Needed simple script to reset multiple images to 100%

    I don't know if this is the right place to ask, but I cannot find such a script anywhere: what I want is to reset the size of multiple selected images back to 100%.
    Looks like such a simple and needed function is not included in InDesign CS3...
    (MacBook Pro, Indesign CS3).

    "codevar" at the start oughta be just "var".
    "idx[idx]." oughtta be "sel[idx]." -- twice.
    Otherwise (untested) it seems it should work.
    Harbs, was this sent by e-mail? I've been having flowers weird problems lately, trying to format something as quote or code with the flowers Jive web editor. Some flowers line of flowers java keeps popping up -- using IE 8, latest flowers update.

  • Reset clipping Path after replacing image?

    Hello
    I have some code that works in CS3 but not in CS4. I need to reset the clipping path used after replacing an image in CS4. I use the method below to do this.
    If I go to "Object->Clipping path Options " after I have updated the image, the settings look ok, but the whole image is show and not the selected path. If I change something in the dialog, like Inset frame , the the correct path is applied. Do I need to redraw the image somehow after I have processed the kSetClipValuesCmdBoss command?
    Best regards
    / Pontus
    ErrorCode     PnlTrvUtils::ResetClipping(IPlaceBehavior *srcRoot, IClipSettings *iOldClipSettings, IDocument *doc, UID newItem) {
        ErrorCode err = -1;
        do {
            uint32 alphaCount = 0;
            uint32 clipCount = 0;
            bool8 bCopyOldClip = kTrue;
            bool8 bUpdateClip = kFalse;
            IClipSettings::ClipType clipType = IClipSettings::kClipNone;
            if (! iOldClipSettings) {
                // CAlert::ErrorAlert("no old clip");
                break;
            if (iOldClipSettings)
                clipType = iOldClipSettings->GetClipType();
            if ( clipType != IClipSettings::kClipNone )
                int16 pathOrAlphaIndex = IClipSettings::kDefaultClipIndex;
                InterfacePtr<ICommand> settingsCmd(CmdUtils::CreateCommand(kSetClipValuesCmdBoss));
                InterfacePtr<ISetClipValuesCmdData> clipSettingsData(settingsCmd, IID_ISETCLIPVALUESCMDDATA);
                if (clipSettingsData)
                    // CAlert::ErrorAlert("clipSettingsData");
                    // Decide which cliptype to use and make sure the old settings
                    // for the cliptype are still valid for the new image.
                    switch (clipType)
                        case IClipSettings::kClipEmbeddedPath:
                            // CAlert::ErrorAlert("embeddedpath");
                            pathOrAlphaIndex = iOldClipSettings->GetEmbeddedPathIndex();
                            PMString num("");
                            num.AppendNumber(pathOrAlphaIndex);
                            CAlert::ErrorAlert(num);
                            // Make sure new image has a clipping path
                            InterfacePtr<IImageIOPreferences> newImageIOPrefs( srcRoot, UseDefaultIID() );
                            if (! newImageIOPrefs || newImageIOPrefs->GetCreateClippingFrame())
                                clipCount = GetClipCount(srcRoot);
                            if (!Utils<IScriptUtils>()->IsINX())
                                bCopyOldClip = kFalse;
                                bUpdateClip = kTrue;
                            if ( ! clipCount ) {
                                pathOrAlphaIndex = IClipSettings::kDefaultClipIndex;
                                clipType = IClipSettings::kClipNone;
                                bUpdateClip = kFalse;
                            else if ( clipCount <= pathOrAlphaIndex ) {
                                pathOrAlphaIndex = IClipSettings::kDefaultClipIndex;
                                // Update the clipping
                            break;
                        case IClipSettings::kClipAlpha:
                            pathOrAlphaIndex = iOldClipSettings->GetAlphaIndex();
                            // If the old setting is Alpha, make sure the new graphic supports the alpha settings.
                            alphaCount = GetAlphaCount(srcRoot);
                            if ( ! alphaCount ) {
                                pathOrAlphaIndex = IClipSettings::kDefaultClipIndex;
                                clipType = IClipSettings::kClipUserPath;
                            else if ( alphaCount <= pathOrAlphaIndex ) {
                                pathOrAlphaIndex = 0;
                            break;
                    PMString num("");
                    num.AppendNumber(pathOrAlphaIndex);
                    CAlert::ErrorAlert(num);
                    // hkhalfal: (NACSR) No abortable command sequence is used
                    // errors occurring in this scope will not revert the changes
                    GlobalErrorStatePreserver errorStatePreserve;
                    clipSettingsData->SetImageItem(::GetDataBase(doc), newItem);
                    clipSettingsData->Set (clipType,
                        pathOrAlphaIndex,
                        iOldClipSettings->GetTolerance(),
                        iOldClipSettings->GetInset() + 1.0,
                        iOldClipSettings->GetThreshold(),
                        iOldClipSettings->GetInvert(),
                        iOldClipSettings->GetUseHighRes(),
                        iOldClipSettings->GetAllowHoles(),
                        iOldClipSettings->GetRestrictToFrame());
                    if ( CmdUtils::ProcessCommand(settingsCmd) != kSuccess)
                        // Error Handling goes here.
                        // CAlert::ErrorAlert("err");
                    // CAlert::ErrorAlert("cmd ok");
        } while(false);
        return err;

    A clipping path is equivalent to a Mask or a Track Matte in After Effects.
    To use your Illustrator logo as a track matte, place it's layer above the Fill layer, and then choose the Alpha Matte option from the Matte drop-down list on the Fill layer.
    For more information:
    http://livedocs.adobe.com/en_US/AfterEffects/8.0/WS3878526689cb91655866c1103906c6dea-7cf8. html

  • We need a script that will select clipping path for multiple images in indesign

    this is what we have, but it's not working:
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll; 
    app.doScript(resetAllClippingPathsToActiveDoc, ScriptLanguage.JAVASCRIPT, [], UndoModes.ENTIRE_SCRIPT, "Reset all Clipping Paths of the Active Document"); 
    function resetAllClippingPathsToActiveDoc(){ 
        var d=app.activeDocument; 
        var allGraphicsInDoc = d.allGraphics; 
        for(var n=0;n<allGraphicsInDoc.length;n++){ 
            if(allGraphicsInDoc[n].hasOwnProperty("clippingPath")){allGraphicsInDoc[n].clippingPath.c lippingType = ClippingPathType.PHOTOSHOP_PATH};
                allGraphicsInDoc[n].clippingPath.appliedPathName = "Path 1"; 

    this is what we have, but it's not working:
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll; 
    app.doScript(resetAllClippingPathsToActiveDoc, ScriptLanguage.JAVASCRIPT, [], UndoModes.ENTIRE_SCRIPT, "Reset all Clipping Paths of the Active Document"); 
    function resetAllClippingPathsToActiveDoc(){ 
        var d=app.activeDocument; 
        var allGraphicsInDoc = d.allGraphics; 
        for(var n=0;n<allGraphicsInDoc.length;n++){ 
            if(allGraphicsInDoc[n].hasOwnProperty("clippingPath")){allGraphicsInDoc[n].clippingPath.c lippingType = ClippingPathType.PHOTOSHOP_PATH};
                allGraphicsInDoc[n].clippingPath.appliedPathName = "Path 1"; 

  • At open, illustrator puts clipping path on images and slices it up HELP!

    I am still using CS2, but this same problem has happened when I open a legacy (older version) file in CS4.....   When I open a file, it all of a sudden has a clipping path around the image.  Also, it is slicing up some images randomly.  It is very strang and I can't explain it.  I just saved and closed the file yesterday and today I go to open it on the same computer and all the photos have these clipping masks around them and some are sliced into multiple pieces.  Can anyone help with this???

    It's easily explained: It is opening the data as if it were an EPS or PDF, so the fault is probably with the options you chose when you saved the files in
    CS2. Check them. also of course keep in mind that some specific features have notably changed, so it may do thius simply to retain appearance, which you can influence by setting teh respective prefs....
    Mylenium

  • Help! Getting clipping paths back on exported lightroom images!

    A bit of a problem.
    I have 22,000 images, half of which were colour corrected in lightroom, but all 22,000 were exported from lightroom.
    So, out of the 22,000 exported files I don't know which ones were colour corrected or not, which is not important until I realise that non of my clipping paths stayed with the exported files.
    There were clipping paths on about 6,000 of these images.
    So first, is there any way of finding from the exported files which ones were worked on in lightroom?
    Secondly, is there a clever scripty way of bringing a clipping path from one photoshop file to another photoshop file (pixel perfect).... preferbly maybe having a folder full of doner files that have the clipping paths that a script gets their clipping paths and puts them onto the photoshop files in the second folder (the two folders will have files with same file names?)

    Unless you specifically set Lr to overwrite the original export creates anew file, which doesn't include layers, clipping paths, Smart Objects and a bunch of other Ps stuff. Hopefully, your original with clipping paths is still around because that's the only way you're getting them back.
    BTW: as you've discovered, editing an image in Lr after t's been edited in Ps is leaving yourself open to a world of hurt, especially when the image includes editing features that Lr doesn't support.

  • Unwanted multiple clipping paths created

    In Illustrator CS4, Mac OS 10.5.8 - I open a document: any color mode. I place a tif image and then apply a clipping mask to crop the image. When I reopen the document, multiple clipping masks are now added around the image (at the edge of the entire placed image.) How do I stop this?

    Screen Shot 1 of 3: Here is a placed image, with one clipping path. I've saved it and then reopened the file later. You can see the blue rules showing the edge of the actual image and the path of the original clipping mask. It's small but the document info palette says "Clipping Masks: 4".
    Screen Shot 2 of 3: I have released the clipping mask and you can see the paths of the other mysteriously "added" clipping masks.  They are grouped with the image. After ungrouping I can move the image and the added clipping masks are left in place.
    Screen Shot 3 of 3: I've now moved the image again and there seems to be another "mask" or path really close to the image edges. I can delete the path and the image still remains. So it is not the edge of the image I am seeing.

  • Script to Sort Images with/without Clipping Paths?

    I've searched for a while and can't find a script that will sort a folder of images into two new folders that contain images with and without clipping paths. Anyone have or know of a script that will do this for me? I'd would greatly appreciate it. W7, PS CS5 32 and 64 bit.
    Thanks in advance!
    Andy

    Hi Andy, Mike has a function to check for clipping groups but requires the file to be open...
    // Function: clippingPathIndex
    // Description: Gets the index of the activeDocument's clipping path
    // Usage: clippingPathIndex()
    // Input: None
    // Return: Index as Integer. -1 if there is no clipping path
    function clippingPathIndex(){
         var ref = new ActionReference();
              ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
         var desc = executeActionGet( ref );
         var clippingPath =  desc.getObjectValue(charIDToTypeID("Clpg"));
         return  clippingPath.getInteger(charIDToTypeID("ClpI" ));
    I think it should be possible to check the files without opening them using Bridge, looking at the Photoshop File Format it says....
    If the file contains a resource of type 8BIM with an ID of 2999, then this resource contains a Pascal-style string containing the
    name of the clipping path to use with this image when saving it as an EPS file. 4 byte fixed value for flatness and 2 byte fill rule.
    0 = same fill rule, 1 = even odd fill rule, 2 = non zero winding fill rule. The fill rule is ignored by Photoshop.
    I will see if I have time today to put something together for you.

  • Exporting Images and Clipping Paths

    I ran into a problem exporting images the was previously reported by Ruvan Fernando on Jan 25, 2006, but nobody had responded, so I'm trying again...
    I'm using the SDK to open images and then save them back out with different colorspaces, resolution, etc. When I have an image that has a clipping path in it, when it's saved, the clipping path is missing.
    I am copying all the source image attributes to the destination image attributes.
    Any help would be appreciated.

    I tried dragging it, and it gave the original version.
    At Share there are; Print, Email, Desktop, HomePage, .Mac Slides, Order prints, Send to iDVD, Burn Disk, Export
    I tried Desktop and it put the current image do my wallpaper.

  • How do I show a clipping path on an image in Illustrator?

    Hi there
    I am a beginner when it comes to Illustrator and only use it when I have to - like now!
    I was wondering - Is it possible to place an image into an AI file and show its clipping path? (that was created in Photoshop)
    I have tried saving the image as a TIFF, PSD but no luck.
    I have also attached a screen shot - just to show the image that has a path.
    Thanks in advance.

    I have placed the image but the 'Embed' option isn't highlighted so I can't click on this!
    I think I have worked out another way to do this - I have saved the image on a transparent background in photoshop as a psd file and then when I place this in AI, the Photoshop Import options box appears and with this set to 'Convert layers to objects' it somehow
    works! like so............ (probably not the best way to do it?!!)

  • Cutting out images in indesign, clipping path problems

    Hi,
    I have been putting images of my drawings from photoshop onto indesign for my portfolio,  after looking around the only way I can seem to find to cut them out is using clipping path/detect edges.
    The problem I have is because they are scanned sketches this method produces really inacurate and shoddy results and no matter how much I play around with the threshold and tollerance this means I still have to mess around with the pen and arrow tool for ages on each image.
    Is there a quicker solution to cutting them out like the magic wand or lasoo tool on indesign?
    It has taken days now in in design , I have all the images already cut out from their original pages on photoshop but the white box always comes around again when I drag or place the images in indesign.
    I have been shorcutting some pages and doing layout on photoshop and placing the image behind which works fine sometimes but is really inconviiant when I want to move the layout around text ot anything...... i have attatched some pictures to show you what I mean.
    Thanks for your help in advance
    Leo

    Well Thats 2 days of my life Ill never get back!
    Thankyou very much! cant belive I was that stupid

  • White outline on outside of clipping pathed images brought into InDesign

    Hi. I am on a PC using CS6.
    I created some clipping paths in Photoshop on a bunch of images and most of them have a white outline (even in Overprint Preview) shown in InDesign.
    I thought I was being careful not to be too close to the edge in order to not get that white outline. I created the paths using the pen tool and path palette.
    Please take a look at the screen shots below and I was wondering if anyone has this problem or if there is something I am totally missing.
    As you can see in this photo the white outlines are around part of the box and most of the separate pieces of chocolate. This is a screen shot from InDesign.
    This same image is below shown in Photoshop with a black rectangle placed behind it and I do not see the white outline. The outline shows in the PDF too when exported so I don't know what to do and I worried it will print this way. Never had this problem before..

    Willi, I used your suggestion and I didn't know what I was doing, but it seemed to have worked. I followed that tutorial from that link I posted earlier. I guess I didn't have to worry about a background image. I wonder why that happened, I've never had this problem before.
    I used a Photoshop image rather than a tif file. I tried using a Photoshop file earlier on in the game and had the white edges still, but did not use the Alpha channels.
    Thanks all for your help and awesome time-saving tips!!!

  • Why when I edit object in acrobat x are the images sometimes rotated or lose their clipping paths?

    Why when I edit object in acrobat x are the images sometimes rotated or lose their clipping paths?

    Have you looked at re-arranging the reading-order itself under View/Navigation Panels/Order/
    This will provide you with the ability to fine-tune content for reflow and read-aloud ..
    Hope this helps,
    Jon

  • Need to find if Images applied clipping path(detect Edges)

    Hi Scripters,
    How to find Images applied with clipping path(detect Edges) in Indesign document.
    Could anybody please share a code/script with me.
    Yours,
    Jerome

    No problem -- a document's "allGraphics" property lists all of the imported graphics in the document. Just check each of them one by one. This little script alerts you with the name:
    for (img=0; img<app.activeDocument.allGraphics.length; img++)
    if (app.activeDocument.allGraphics[img].clippingPath.clippingType == ClippingPathType.DETECT_EDGES)
      alert (app.activeDocument.allGraphics[img].itemLink.name);

  • How do I copy clipping masks including relative positions for multiple images?

    I have a number of microscope images of the same subject that were taken under three different conditions. I'd like to use clipping masks to crop the images in the same way (the same size but also the same positions relative to the corners/sides of the images. In case that was incoherent, I made an image to try to explain what I'm trying to achieve (the same portion of each image for each set):

    condor,
    You may, with one image in the set masked:
    1) Direct Select the Clipping Path and Ctrl/Cmd+C+F+X+F, then move it by the distance between the centres of the images; you may do that for the whole set by repetition;
    2) Select the/each image and path and Object>Clipping Mask>Make.
    Alternatively, in 1), you may select the Clipping Path (Mask) in the Layers palette, within the Group.
    The Ctrl/Cmd+C+F+X+F is to get the path out of the Group.

Maybe you are looking for

  • How can i hide a pages file from other users

    How can I hide a pages file so other users can't open or see it?

  • Final Cut Studio 2 on iMac to be purchased

    I am a first-time computer buyer, so I'm trying to make sure this purchase is going to be worth it. I'm looking to purchase the iMac off the shelf, but I'm uncertain if I need extra accessories to make Final Cut Studio 2 run. The Mac says it has "ATI

  • Return statement in a try catch block

    Hi friends Take a look in the code bellow try return (true) finally System.out.println("blabla"); If nothing strange hapens in the try code, the return statement will be achieved. In this case, what will hapen ? The code in the finally block will be

  • 10.1.0.5 Patch Set Release Date?

    Hello, Does anyone know the projected release date of the 10.1.0.5 patch set for Oracle Database Server? I'm interested in Solaris SPARC patch set. Thanks, Vlad

  • Have Installed Arch Linux and Xmonad on 2013 15" MacBook Pro Retina

    I just recieved the latest stunning MacBook Pro Retina 15" (ME665) released in Feb 2013, couldn't wait to install the Arch Linux 2013.02.01 on it, dual boot with Mac OSX. I'm impressed by the performance of this device after working with the combo of