Skip navigation
Currently Being Moderated

Delete unused layer..?

Nov 2, 2011 6:11 PM

Hi Everyone!,

 

I am new baby to indesign scripting and anyone to help me find that below indesign script.

 

How do i delete unused layer in indesign CS4? and how do know linked image mode like CMYK, RGB, LAB.

 

Thanks in Advance.

 

- yajiv

 
Replies
  • Currently Being Moderated
    Nov 3, 2011 4:46 AM   in reply to yajiv_viki

    i know of one which only gets rid of invisible layers which can be found at:

     

    http://objectmix.com/adobe-indesign/239660-how-delete-invisible-layers -inindesign-cs2-file-using-javascript.html

     

    alternatively, google the script "inwash.jsx" by vitaly batushev

     

    in terms of finding out if a linked image is CMYK, RGB, LAB etc, this can be done from the links panel itself from CS4 and up. If you can't see it at the moment, go to the panel options within the links panel and select  the following:

     

     

    Screen shot 2011-11-03 at 10.03.32 PM.png

    this is only really useful for rasters such as tiffs, jpgs etc. it won't advise if a PDF contains RGB, CMYK etc for example.

     

    i know it's not what the OP was hoping for, but hope it helps

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 3, 2011 12:05 PM   in reply to yajiv_viki

    This should remove empty layers:

     

    var layers = app.documents[0].layers.everyItem().getElements();
    for(var i=layers.length-1;i>=0;i--){
      if(layers[i].pageItems.length==0){
        layers[i].remove();
      }
    }
    
     
    |
    Mark as:
  • Currently Being Moderated
    Nov 3, 2011 5:56 AM   in reply to yajiv_viki

    place a single image in an empty doc, and this will give you the color space:

     

    alert (app.documents[0].pageItems[0].images[0].space);

     

    Harbs

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 3, 2011 12:07 PM   in reply to yajiv_viki

    The problem was a capital L in getElements()...

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (1)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points