2 Replies Latest reply on Jul 22, 2013 1:52 AM by Laubender

    Duplicate Master Text Frame

    DaveSofTypefi Level 2

      I just tried to use this function to duplicate a master text frame to a new layer, change its contents, and change its fillColor.

       

       

      function makeNewPhoneFrame(aText, layer, phone, swatch) {
                var yenFrame = aText.parentTextFrames[0];
                var newFrame = yenFrame.duplicate(layer, [0,0]);
                newFrame.texts[0].contents = phone;
                newFrame.texts[0].fillColor = swatch;
      }
      

       

      Everything worked except the duplicates showed up on page 1 of the document and not on the master page -- is this a known feature of the duplicate method?

       

      I guess its easy enough to move the new frames to where I want them.

       

      FWIW, I'm using InDesign CC, but I can't imagine this is something new in CC.

       

      Dave

        • 1. Re: Duplicate Master Text Frame
          DaveSofTypefi Level 2

          Indeed, this works:

           

          function makeNewPhoneFrame(aText, layer, phone, swatch) {
                    var yenFrame = aText.parentTextFrames[0];
                    var newFrame = yenFrame.duplicate(layer, [0,0]);
                    newFrame.move(yenFrame.parentPage);
                    newFrame.move([yenFrame.geometricBounds[1], yenFrame.geometricBounds[0]]);
                    newFrame.texts[0].contents = phone;
                    newFrame.texts[0].fillColor = swatch;
          }
          

           

          But it's somewhat annoying to have to go through such hoops.

           

          Thinks: maybe this always happens when you duplicate to a layer, no matter whether the original is on a master or not.

           

          I'll check that when I have the time.

           

          Dave

          • 2. Re: Duplicate Master Text Frame
            Laubender Adobe Community Professional & MVP

            @Dave – what  also would work:


            1. duplicate without arguments
            2. assign layer of original

            3. move to required position

             

            One more thing: if you duplicate an anchored or inline object, you'll  possibly be surprised…
            (Check the position of original and duplicated page item!)

             

            Uwe