Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Script to override master page items

Return to Member Forum

  • Author
    Posts
    • #71382
      Oleh Melnyk
      Member

      Hi,

      I need script that will override all master page items.

      I have found few scripts, but they doesn’t work at all, or work not the way they should.
      Some of them do override, but elements on the page became shifted – in this topic [ https://forums.adobe.com/thread/1455184?start=0&tstart=0 ] scripters found out how to fix this shift, but this script doesn’t work for me – it doesn’t do override – just create empty pages at the end of the document.. and seems it’s work only with “A-Master”, “B-Master”, “C-Master”, and I need it to work with all masters..

      so, can anybody help me to figure out how to make script that will override master page items without shifting?

    • #71467
      swan pado
      Member

      try {
      //Active Document
      var appDoc = app.activeDocument;
      //All Master Spreads
      var allMasSprs = appDoc.masterSpreads;
      //All Document Pages
      var allPages = appDoc.pages;
      //Document Page
      for (var p = 0; p < allPages.length; ++p) {
      var tarMasPgItems = allPages[p].masterPageItems;
      //Master Page Items
      if (tarMasPgItems.length > 0) {
      //Master Page Item
      for (var m = 0; m < tarMasPgItems.length; ++m) {
      try {
      //Allow Override
      if (allPages[p].masterPageItems[m].allowOverrides == true) {
      allPages[p].masterPageItems[m].override(allPages[p]);
      }//end if //Allow Override
      } catch (er) {/*Inheritance Master Page Final Override Item*/}
      }//end for //Master Page Item
      }//end if //Master Page Items
      }//end for
      } catch (err) {
      Window.alert(err);
      }

    • #71473
      Oleh Melnyk
      Member

      @swan pado – I don’t know why, but your script overrides only 2 of 4 master page items on the page.. and what even worse – overriden elements get shifting – before override elements had position of X: 65.225mm Y: 269.4mm and after override elements was shifted to X: 59.325mm Y: 278.2mm

    • #14393329

      Hello!

      I’m using this script but it works master by master.
      My documents have three or more masters.
      Is it possible to override them all in one click?

      Thanks!

    • #14393330

      I,m using indesign 2021

Viewing 4 reply threads
  • You must be logged in to reply to this topic.
Forum Ads