Skip to main content
Inspiring
July 14, 2017
Answered

Get pasteboard items

  • July 14, 2017
  • 1 reply
  • 2971 views

Hi,

     I need to get the paste board items if the document contains pasteboard items.  When i am searching in forum, i found the below url .

Pasteboard items information

Its removing all items from the page.  Actually paste board item is, the items which are outside of the pages right?? or I am guessing it wrongly???

How can i find whether document have paste board items (Outside of pages) or not ?

- Sudha K

This topic has been closed for replies.
Correct answer Laubender

Hi Sudha,

if all things you want to ignore are on masters you could start with an array of pageItems in spreads:

var pageItemsOnSpreadsIncludingDocPagesButNotMasters = app.documents[0].spreads.everyItem().pageItems.everyItem().getElements();

and loop the array.

If that is not working it's getting complicated.

Especially with arbitrary shapes.

One algorithm could be to create a rectangular shape in size and position of a page plus the area of the slug and test for items totally outside with duplicates of their shapes and a decent pathfinder operation.

Regards,
Uwe

1 reply

Chinnadk
Legend
July 14, 2017

Try this,

var doc = app.activeDocument;

var pi = doc.pageItems;

for(var i=0;i<pi.length;i++)

{

        if(pi.parentPage == null)

        {

                //

            }

    }

Regards,

Chinna

Sudha_KAuthor
Inspiring
July 17, 2017

Thank you....

If the objects are outside side of the page is fine...  Its selecting Header contents textframe above the redline.  How to avoid this??

Also if the object position is half is outside and half is in marginal.  How to capture this case??