[CS2] [JS]  Apply photoshop clipping path

Hi,
Does anyone know how to apply the photoshop clipping path to all images in a document, If the image contains one ?
I can't find a clipping path property of the graphic object in the reference manual...
The loop structure itself is not a problem...
for (var j = app.activeDocument.allGraphics.length - 1; j >= 0; j--) {
Thanx
Tim

Hi Peter,
I've just tried using...
for (var j = app.activeDocument.allGraphics.length - 1; j >= 0; j--) {
try
var theEPSItem = app.activeDocument.allGraphics[j];
var theClippingPath = theEPSItem.clippingPath;
if ( ( theClippingPath.clippingType != ClippingPathType.photoshopPath ) &&
( theClippingPath.photoshopPathNames.length > 0 ) )
theClippingPath.clippingType = ClippingPathType.photoshopPath;
catch ( e )
... something strang happens when running the script. The clipping path settings of the EPS-files are changed and are correct. However, the result is not yet visible. So I still have to open the clipping path settings menu and click on the ok button... Then the result is displayed.
Any idea's ?
Tim

Similar Messages

  • JS that applies all clipping paths at once?

    Hello,
    I found the thread that contains the Applescript for this, but would love to have a Javascript that works the same. Anyone have or know of one for ID CS5 that will apply all clipping paths for a group of objects at once?
    Thanks in advance, as always
    Andy

    So it's all Photoshop paths? Yes, it ought to work. Perhaps you also need to specify which path ... Try with this line added:
    app.selection[i].images[0].clippingPath.appliedPathName = app.selection[i].images[0].clippingPath.photoshopPathNames[0];
    inside the try { .. } catch block. This ought to set the clipping path to the very first one in the file.
    It's important to do operations such as these inside a try .. catch block, because this construction shields you from errors. Without the try .. catch, the script would issue an error for the very first image it encounters that has zero paths (and thus "the first", which is numbered #0, is not valid) and then stop with the error alert. Now it will still signal the error but the 'error handler' (the second curly-bracketed part) ensures it does nothing with that information, and so it will ignore the error and continue with the next image.
    And yes, a Javascript needs to be saved as ".jsx" to work. Otherwise InDesign doesn't recognize it as a valid script.

  • Is there anyway to activate photoshop clipping paths automatically in CS4/5?

    Hello,
    Can a preference be set in Indesign to automatically apply the photoshop clipping path to Tiff images?
    Cheers Joe.

    You don't need to specify a flatness for indesign to pick up on that path, just need to set that it is the preferred path for an application to use. Paths aren't exclusively used for the purpose of knocking out a background or portion of a photo. You could google up device path flatness and you'll find a spiel something to the effect of set it quite a few pixels for very high res scans, fewer for low res. I believe it is just the tolerance for the application to use in interpreting which pixels to use. After all, a path is a vector outline and the application needs to determine how to cut the photo, which pixels to keep and which to exclude.
    Short adobe word on it.
    http://kb2.adobe.com/cps/327/327368.html

  • Photoshop Clipping Paths to Illustrator

    When I make a clipping path in photoshop and save it as a .psd and then place it in Illustrator the bounding box of the path is the whole image and not just the bounding box of the path. How can I make it just the bounding box of the path? Export it a different way or what? Another computer does what I want to happen, but this one will not.

    Only way is to crop your image in Phoshhsop
    CMD click on path name
    Image >> Crop
    Save
    Unfortunately the bounding box is defined in Photoshop and Illustrator >> link palette >> placement options will NOT help you. So don't waste your time there with this old, of little use placement options.

  • Photoshop clipping path?

    Can anyone tell me how to drop a background out of a photo & make it transparent?

    A Clipping Path is just one option.
    Another would be to use a psd with transparency (for example by making the background layer a regular one by double-clicking it and using the Selection and Paint Tools to create and edit a Layer Mask for that).
    Please check out
    http://feedback.photoshop.com/photoshop_family/topics/removing_background_from_image

  • Suggested New Feature to Photoshop Clipping Path Lines

    I've been using Photoshop for 20 years, and now that I'm 51 yrs old I have an increasingly hard time seeing the thin clipping path line if it is on a dark texture.  Yes, I have had my eyes checked very recently, and yes, I do need eyeglasses when working on the computer now.  I would like to suggest that Adobe consider adding a feature that allows a user to choose line weight and color.  It would really be helpful.  Age has certainly taken it's toll on my eyes (and my hair)!  Does anyone else have my same issue?

    Clipping Path or are you referring to the Pen Option ruber Band?

  • IDCS2 How to use Photoshop Clipping Path at TIFF import

    For EPS-Import there are IEPSPrefs!
    But how do i activate a Use-PS-Clipping-Path when importing a TIFF?

    For EPS-Import there are IEPSPrefs!
    But how do i activate a Use-PS-Clipping-Path when importing a TIFF?

  • Photoshop Clipping Path Glitch

    I just got a new computer and installed CS5 on it and I'm noticing whenever I use the pen tool my clipping path is invisible.. The pen tool is still working, if I can still make a selection from said invisible clipping path, but its proving to be really annoying, as I have some pretty intense selections to make at work.. Does anyone know of a fix for this problem? Is is a common one?
    Side Notes:
    The monitor is the same as the one I was using before I got this new computer, the problem only started with the new computer.
    The resize box (free transform tool) also is invisible.

    Clipping Path or are you referring to the Pen Option ruber Band?

  • Linking Photoshop EPS Files with Clipping Paths

    I'm running InDesign CS4 6.0.3 on a dual 2GHz G5 with Mac OS X 10.5.7.
    We have a workflow that involves Photoshop EPS files being placed in InDesign with the object's clipping path set to Photoshop Path.  If the link is updated or relinked, InDesign no longer restricts the image to the boundaries of the path—either on screen or on export to PDF—even though choosing Object -> Clipping Path -> Options still shows the type set to Photoshop Path.  The only way that I have found to get the clipping path to fully apply to the image is to change the type from Photoshop Path to None and back to Photoshop Path, all while the Preview check box is on.  I tried different combinations of turning the Apply Photoshop Clipping Path option on and off at the time of initial placement and at the time of relinking with no effect on this behavior.
    Assuming that using a format other than EPS and using transparency rather than clipping paths are not in play at the moment, my questions are:
    1.  Is this a know issue with InDesign CS4?  If so, can we expect a fix soon?
    2.  Is there anything that can be done on the user side that is less cumbersome than the workaround described above?

    @Mark
    Photoshop PSD is fine for all raster work. But if you have vector masks, vector shapes or text in the file then saving as PDF would be the better option, you can choose to remove the white background when importing the PDF in the Show Options of the Place Dialog box.
    And that's null point anyway, as soon as you open a photoshop EPS file in Photoshop it rasterises everything. So what I said isn't a viable solution for this project. But to keep in mind that PSD will output as raster only and PDF can have transparency and raster + vector data.
    Just thought I'd through that out there.

  • 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);

  • Possible bug in Clipping Path - weird behaviour

    I've got a bunch of images with clipping paths. All the same size. They're all book covers from a series.
    Well I applied a clipping path to all of them.
    Some when placed into InDesign will place fine with the clipping path applied.
    Others will not - and the only difference I can see is that:
    The images that import with the clipping path applied - in Photoshop they are as Layer 1 and a Background Layer
    The images that import without a clipping path applied - in Photoshop they are flattened.
    Is that the same behaviour for everyone else - would you consider it a bug?
    InDesign CS5 - Fully Patched
    Photoshop CS2 - Fully Patched
    Photoshop File Type> TIFF

    Yeh I can apply the Path after placing - Jongware wrote me script to apply the photoshop path.
    But I just think it's odd behaviour.
    On most of them that are flattened - there is no option to Apply the Photoshop Clipping Path - it's greyed out.
    Then on the ones with layers - the option is selectable.

  • 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

  • Illustrator CS6: deleting unwanted items outside a clipping path

    Hi everyone,
    I'm creating a logo that employs a stippled texture (a half-tone) in various sections of objects comprising the logo. I've placed the stipple where I want it, created a clipping path to capture the area. Now I have all these other points that I don't need that I want to delete.
    Is there anyway short of releasing the clipping path, manually delete unwanted sections of the stipple and then re-apply the clipping path again? It would be like 'Applying Mask' in photoshop.

    You can enter isolation mode without releasing the clipping mask. Beyond that I don't see a way to do this automatically unless you want to make your stipples a compound path or group and use Pathfinder operations. Unfortunately AI doesn not have inside/ outside detection for these kinds of scenarios that wouzld allow to quickly select separate objects in this fashion...
    Mylenium

  • Bring in another .psd file with the clipping path

    Okay, this client has a very odd request. They want a collage of images put together in one file and they want the clipping paths to be attached. Then it's to be saved as an eps file. I'd like to do this in InDesign and am going to be posting this same question there as well. I like that in InDesign, the clipping path stays attached to the image when you move it. However, is there a way to do this in Photoshop? I don't know how to bring .psd files into Photoshop along with their clipping paths. If there is a way to do this, is there a way to link the clipping path to the layer so that when I move the individual layers, the clipping path moves with it?
    Help would be greatly appreciated! Thank you!

    In Photoshop "Clipping Path" is a special kind of Path and limited to one per image and not linked to one Layer.
    A work-around to combine multiple images with individual Clipping Paths into one psd file with a combined Clipping Path could be
    • applying the Clipping Paths as Vector Masks to the images (flattened to one Layer or converted to a Smart Object each),
    • combining them and after positioning/transforming/…
    • copy/pasting the individual Vector Masks into one new Clipping Path.

  • Clipping path - automation

    Hello,
    For some time I have been trying to figure out a problem I am having with a script.
    I have succeeded to write a script that does exactly what I want, wich is having Photoshop opening selected files, then apply the clipping path and finaly save as .png
    The only problem I am experiencing is when Photoshop (CS 5.5) opens the selected number of files, it only applies the script to the first opened file, while the others remain unedited...
    I was hoping to find some help and or a solution in solving this problem.
    Thanks a lot in advance!
    Kind regards,
        #target photoshop
    //Input selection
    var myInputFolder = Folder.selectDialog ("INPUT");
    if(myInputFolder!=null){
        var myFiles = myInputFolder.getFiles(/.(jpg|psd|tif|png)$/i);
        for(var fileIndex=0;fileIndex<myFiles.length;fileIndex++){
            var tempDoc = app.open(myFiles[fileIndex]);
    //Track
    docs = app.documents;
    for (i=0; i < docs.length; i++) {
        doc = docs[i];
        app.activeDocument = doc;
    //Unlock Layer
    docLay=app.activeDocument.layers;
    l=app.activeDocument.layers.length;
    while (l>0) {
        l--;
        docLay[l].isBackgroundLayer = false;
        docLay[l].allLocked = false;
    //Clipping path
        if (app.documents.length > 0) {
        if (app.activeDocument.pathItems.length > 0) {
        var thePath = app.activeDocument.pathItems[0];
        app.activeDocument.selection.selectAll();
        thePath.makeSelection(0, true, SelectionType.DIMINISH);
    //Clear Selection
    try {
    app.activeDocument.selection.clear();
    } catch(e) {
    alert("Sorry, dit document bevat geen pad!");
    //Resolution
       var doc = activeDocument;
       var res = doc.resolution;
       doc.resizeImage(undefined, undefined, 150, ResampleMethod.BICUBIC);
    //Trim
    app.activeDocument.trim()
    //Save PNG
    var doc = app.activeDocument;
    var Path = doc.path;
    var Name = doc.name.replace(/\.[^\.]+$/, '');
    var Suffix = "_DSok";
    var saveFile = File(Path + "/" + Name + Suffix + ".png");
    SavePNG(saveFile);
    function SavePNG(saveFile){
        pngSaveOptions = new PNGSaveOptions();
    activeDocument.saveAs(saveFile, pngSaveOptions, true, Extension.LOWERCASE);
    activeDocument.close(SaveOptions.DONOTSAVECHANGES);

    I didn't have how you set up your files to test this, so I hope it works.
    #target photoshop
    //Input selection
    var myInputFolder = Folder.selectDialog ("INPUT");
    if(myInputFolder!=null){
        var myFiles = myInputFolder.getFiles(/.(jpg|psd|tif|png)$/i);
        for(var fileIndex=0;fileIndex<myFiles.length;fileIndex++){
            var tempDoc = app.open(myFiles[fileIndex]);
    //Track
    //declare all variables.
    var doc, res, Path, Name, Suffix, saveFile
    var docs = app.documents;
    for (i=0; i < docs.length; i++) {
        doc = docs[i];
        app.activeDocument = doc;
    //Unlock Layer
    docLay=app.activeDocument.layers;
    l=app.activeDocument.layers.length;
    while (l>0) {
        l--;
        docLay[l].isBackgroundLayer = false;
        docLay[l].allLocked = false;
    };//end while loop
    //Clipping path
        if (app.documents.length > 0) {
        if (app.activeDocument.pathItems.length > 0) {
        var thePath = app.activeDocument.pathItems[0];
         app.activeDocument.selection.selectAll();
        thePath.makeSelection(0, true, SelectionType.DIMINISH);
            }//end if app.activeDocument.pathItems.length
        };//end if app.documents.length
    //Clear Selection
    try {
    app.activeDocument.selection.clear();
    } catch(e) {
    alert("Sorry, dit document bevat geen pad!");
    }//end catch
    //Resolution
       doc = activeDocument;
       res = doc.resolution;
       doc.resizeImage(undefined, undefined, 150, ResampleMethod.BICUBIC);
    //Trim
    app.activeDocument.trim()
    //Save PNG
    doc = app.activeDocument;
    Path = doc.path;
    Name = doc.name.replace(/\.[^\.]+$/, '');
    Suffix = "_DSok";
    saveFile = File(Path + "/" + Name + Suffix + ".png");
    SavePNG();//removed saveFile since it's global, you don't need it here.
    };//end for loop that sets each document as active.
    function SavePNG(){
        pngSaveOptions = new PNGSaveOptions();
    activeDocument.saveAs(saveFile, pngSaveOptions, true, Extension.LOWERCASE);
    activeDocument.close(SaveOptions.DONOTSAVECHANGES);
    };//end function SavePng

Maybe you are looking for

  • Error on hover panel of people search result "We weren't able to find additional information"

    In people search result while hovering over all result item, in the hover panel in the middle I can see a message "We weren't able to find additional information". I saw a msdn post for the same question in this MSDN Link but there it is said that "I

  • Retained Earnings Account query

    Hi Folks, At Ledger level we can assign one balancing segment value for Retained earnings account , where as if we have multiple balancing segment values in same BG LE and OU so how we can differentiate the retained earning account balances for diffe

  • ACE VIP OK HTTP, NOK other TCP port

    Hi, we are having issues in configuring load balancing for a TCP port. For HTTP it's working without issues and we have the ACE also balancing for other TCP ports. Here goes the relevant config: probe http PROBE-HTTP   interval 5   passdetect interva

  • (multiple) ResultSet problem

    I'm quite new to Java, but I couldn't find the answer to my question anywhere. 1. It's an applet 2. I'm using a MS Access 2000 ODBC/JDBC database 3. Everything seems to work. I can connect, I can see the database entry if using the first ResultSet ("

  • History button disappears.

    I recently gave in and upgraded to the latest Firefox (3.6.3 specifically) after ages stubbornly sticking to Firefox 3.0. All in all upgrade has gone well. However, lately I find that the history button next to the url bar randomly disappears. It's e