Pasting on multiple pages?

Learn / Forums / General InDesign Topics / Pasting on multiple pages?

Tagged: ,

Viewing 11 reply threads
  • Author
    Posts
    • #61582

      When I was working with Quark XPress, I used to have an extension allowing for pasting on multiple pages. I looked in the Help and did a quick search online but couldn't find a solution for that in InDesign.

      Ideally, I'd like to be able to select a few objects, that might not be on the same layer, select a range of pages, and be able to paste these objects on those pages all at once.

      Do you know if this is possible? If not, is there a script for that?

      Thanks for your help, with my best regards,

      Mathieu

    • #61583
      Eugene Tyson
      Member

      The only way I can think of is to duplicate your master page

      Put the images on the page in the location required and layers required.

      Then select those pages via the Pages Panel – then use the Apply Master Pages, and select the duplicate master page.

      Then all those images would appear on those pages.

      But other than that I think you'd need a script.

    • #61584

      The copying-and-pasting bits are scriptable, but unfortunately the scripting interface doesn't allow access to your 'selected range of pages' in the Pages panel. (If this happens to get added in CS6, it'd be a welcome addition … I could think of a few useful things to do with it!)

      Oh sure you can use Master pages (in fact, do you have reasons not to?), but I've had some fun writing this quick Javascript. It uses logical page numbers, unencumbered by stuff like roman numeral preambles and separe sections, so take care to enter the right ones.

      //DESCRIPTION: Multi Copy to Multi Pages
      // A Jongware script, 2-Feb-2012
      // Make sure there is something appropriate selected
      if (app.documents.length > 0 && app.selection.length > 0 && !(app.selection[0].hasOwnProperty(“baseline”)))
      {
      if (parseFloat(app.version) < 6)
      multiCopy (app.selection);
      else
      app.doScript(multiCopy, ScriptLanguage.JAVASCRIPT, app.selection, UndoModes.ENTIRE_SCRIPT, “Multi Copy to Multi Pages”);
      } else
      {
      alert (“No valid selection.nPlease select one single object with the black arrow before running this script.”);
      }

      function multiCopy (sel)
      {
      originalPage = app.layoutWindows[0].activePage.documentOffset;
      pagerange = prompt (“Apply to page range (logical page numbers):”, String(originalPage+1)+”-“+String(app.activeDocument.pages.length));
      if (pagerange != null)
      {
      pagerange_nrs = pagerange.match(/^(d+)-(d+)$/);
      if (pagerange_nrs.length == 3)
      {
      // ID pages start counting at 0, so subtract 1:
      startpg = Number(pagerange_nrs[1])-1;
      if (startpg < 0)
      {
      alert (“Surely you are joking? You can't start at page 0!”);
      return;
      }
      endpg = Number(pagerange_nrs[2]);
      if (endpg >= app.activeDocument.pages.length)
      {
      alert (“Surely you are joking? You can't continue after the last page!”);
      return;
      }
      // Subtracting 1 not necessary for the end page
      // (that's due to JavaScript for..loop behavior)
      for (i=startpg; i<endpg; i++)
      {
      if (i != originalPage)
      {
      for (j=0; j<sel.length; j++)
      sel[j].duplicate (app.activeDocument.pages[i]);
      }
      }
      } else
      alert ('Bad page range. Please use “from-to” syntax using logical page numbering.');
      }
      }

      (Edit: next time watch out for possible post enhancements..)

      (Edit II: 3rd time lucky?)

    • #61585

      I spotted a tiny tiny error —

      if (endpg >= app.activeDocument.pages.length)

      in line 32 should read

      if (endpg > app.activeDocument.pages.length)

      but I dare not enter the Editor again … (As it is, this script now fails if you attempt to copy stuff all the way up to the very last page.)

    • #61586

      Time flies, I was shaping bezier curves of a new typeface the whole afternoon and suddenly noticed some answers to my post.

      Dear Eugene,

      Thank you for your idea, I haven't thought about it, that's clever.

      Dear Jongware,

      Many thanks for that script, it does the trick just as I was expecting the magic to operate!

      Best regards, M

    • #61591
      Eugene Tyson
      Member

      Mine might have been clever, but Jongware possesses the genius scripting brain that I lack.

    • #69452

      Hi,

      I remember being able to do this in Xpress. Unfortunately Indesign seems not to have this feature. This script above does not work in CS6 :( Any pointers to a plugin that can paste a copied element in the same position on every page/spread?

      Thanks in advance for any help.

      B.

    • #69486

      Bill,

      An unfortunate mistake in copying the script into the forum. The backslashes in the line #20

      pagerange_nrs = pagerange.match(/^(d+)-(d+)$/);

      somehow disappeared; it should have been

      pagerange_nrs = pagerange.match(/^(\d+)-(\d+)$/);

      I’ve added these, and also did a slightly better check on the page rage. An improved! better! faster! (well, not faster) version can be downloaded from my site:
      https://www.jongware.com/binaries/multipagepaste.zip

    • #109385

      So I had this same desire, and figured a way around it. This will work as long as what you want to paste on multiple pages will be in the exact same spot. I set up where I wanted the pasted item on the first page. Then pasted it to the master page. It instantly pasted to all the pages. This would also work if you want every other page, just page that item to the set master page of those odd or even pages.

      Also, to fix this issue in the future, I created an InDesign file of the thing I wanted pasted. What changes annually is just the date. So that date file can be updated once, then when I open the other file that has it on the master, ALL the pages are updated immediately.

    • #117603
      AARON F
      Member

      Would it be possible to change this to accept a combination of a range of pages and individual page numbers, rather than a just a range. For example pages 6-10,12,14,11 ?

      Alternatively, it would be better to start at a page (ie: page 6) and paste on every other page or every 4th, etc. (variable).

    • #14361927
      Ruo Pu Koh
      Member

      this script doesn’t seem to work with the latest CC. Anyone got an updated version?

    • #14371174
      David Blatner
      Keymaster

      I don’t know if this helps, but I posted Jongware’s last version of his script here: creativepro.com/files/jongware/binaries/multipagepaste.zip

Viewing 11 reply threads
  • You must be logged in to reply to this topic.
>