• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

current page override in layer

Participant ,
Aug 01, 2017 Aug 01, 2017

Copy link to clipboard

Copied

where error

var doc = app.activeDocument;

var page = app.activeWindow.activePage;

var layer = doc.layers.item("Layer 1"); 

    for(var i = 0; i < page.allPageItems.length; ++i) {

        var a = page.allPageItems;

        if(a instanceof TextFrame && a.itemLayer == layer) {

                a.override(page.masterPageItems);

        }

    }

TOPICS
Scripting

Views

508

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Aug 01, 2017 Aug 01, 2017

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Aug 02, 2017 Aug 02, 2017

Copy link to clipboard

Copied

Hi,

And this:

http://www.jongware.com/idjshelp.html

useful as well.

Look into Object Model. Method pageItem.override(page) is assigned to masterSpread pageItems - not to any from doc.

(Overrides a master page item and places the item on the document page as a new object.)

So iterate through page.appliedMaster.allPageItems and override them to page.

Jarek

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 02, 2017 Aug 02, 2017

Copy link to clipboard

Copied

I just want to act on the active page but this error (page don't object)

var doc = app.activeDocument;

var page = app.activeWindow.activePage;

var katman = doc.layers.item("Layer 1"); 

var myItems = page.appliedMaster.allPageItems; 

for(var y=0;y<myItems.length;y++){ 

    if(myItems instanceof TextFrame && myItems.itemLayer == katman){ 

        try{myItems.override(page);} 

        catch(e){alert("error")} 

    } 

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Aug 02, 2017 Aug 02, 2017

Copy link to clipboard

Copied

hamdifem  napisał(-a)

...error (page don't object)

...

Could you paste exact error text?

Does your masterSpread contain more than 1 page (pageItems are left/right located)?

Jarek

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 02, 2017 Aug 02, 2017

Copy link to clipboard

Copied

LATEST

Yes for using overflow on page and The object on the left appears to the right

In new document script worked

overflow in page Is there a solution

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines