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

How to add new pages to a document – on left-hand side

Return to Member Forum

  • Author
    Posts
    • #79102

      How to add new pages to a document on the left-hand side.

      Is it possible to add a specified number of pages, to an existing document, where the new pages will fall on a “left-hand” side (even-numbered pages)?

      My example: I have a four-page document; I want to add an additional 4 pages, of a specific master page, to the document. But, I require the new pages to be placed as left-handed pages (even-number pages).

      I currently have a applescript, that I built & use, to add the four (4) new pages. Unfortunately, the new pages fall at the end of the current document. I cannot figure out how to get them to place properly. I currently do the manual move of the pages.

      Please be nice … my applescritping skill level is just below intermediate. Any suggestions would be greatly appreciated.

      **********
      INSERT • Display Ad pages

      set myFirst_Pagenumber to 1

      –LIST FOR MY COMMEN USE
      –set myMasterChoice to “ADs-Display ad pages”
      –set myMasterChoice to “ADs-Display Ad pages”
      –set myMasterChoice to “ADs-Display Ad Pages”
      –set myMasterChoice to “ADs-Display ads”
      –set myMasterChoice to “ADs-Display Ads”
      –set myMasterChoice to “Ads-Display ads”

      tell application “Adobe InDesign CC 2014”
      activate
      set theDoc to document 1
      set originalPgCount to get count of pages of theDoc

      tell theDoc
      –DETERMINE WHAT THE DISPLAY AD MASTER NAME IS
      try
      if master spread “ADs-Display ad pages” exists then
      set myMasterChoice to “ADs-Display ad pages”
      else if master spread “ADs-Display Ad pages” exists then
      set myMasterChoice to “ADs-Display Ad pages”
      else if master spread “ADs-Display Ad Pages” exists then
      set myMasterChoice to “ADs-Display Ad Pages”
      else if master spread “ADs-Display ads” exists then
      set myMasterChoice to “ADs-Display ads”
      else if master spread “ADs-Display Ads” exists then
      set myMasterChoice to “ADs-Display Ads”
      else if master spread “Ads-Display ads” exists then
      set myMasterChoice to “Ads-Display ads”
      end if
      on error
      tell current application to beep 3
      display dialog “Your \”display ad\” master page was not found !” buttons {“Gee Thanks!”} default button 1 with icon 1 giving up after 2
      return
      end try
      end tell –theDoc

      — SET PAGE NUMBERING TO START AT 1
      tell theDoc
      set continue numbering of section 1 to false
      set page number start of section 1 to myFirst_Pagenumber
      set continue numbering of section 1 to true
      end tell

      — INSERT NEW “DISPLAY AD” PAGES
      tell theDoc
      repeat originalPgCount times
      –make new page at end of theDoc –okay this works
      try
      make new page at end of theDoc with properties {applied master:master spread myMasterChoice, allow page shuffle:true}
      on error
      tell current application to beep 3
      display dialog “Your \”display ad\” master page was not found !” buttons {“Gee Thanks!”} default button 1 with icon 1 giving up after 2
      return
      end try

      end repeat

      –SET GUIDES TO TOP
      set properties of the guide preferences to {guides in back:false, guides locked:false, guides shown:true, guides snapto:true, ruler guides color:cyan, ruler guides view threshold:5.0}

      end tell –theDoc

      end tell –application

      tell current application to beep 2

      *********

    • #79155

      With the help of other skilled applescript users, I found a solution to my dilemma.
      By getting the ID of each page, I was able to place my new pages where I wanted them.
      Here below, is my NEW and REVISED/UPDATED applescript. If you can improve upon it,
      please share with everyone.
      Thank you.

      * * * * * * * *

      (* INSERT • Display Ad pages.applescript *)

      set myFirst_Pagenumber to 1

      tell application “Adobe InDesign CC 2014”
      activate
      set theDoc to document 1
      set originalPgCount to get count of pages of theDoc

      tell theDoc
      –DETERMINE WHAT THE DISPLAY AD MASTER PAGE NAME IS
      repeat with eachItem in {“ADs-Display ad pages”, “ADs-Display Ad pages”, “ADs-Display Ad Pages”, “ADs-Display ads”, “ADs-Display Ads”, “Ads-Display ads”}
      if master spread eachItem exists then
      set myMasterChoice to eachItem
      end if
      end repeat
      –tell current application to beep 1
      end tell –theDoc

      — SET PAGE NUMBERING TO START AT 1
      tell theDoc
      set continue numbering of section 1 to false
      set page number start of section 1 to myFirst_Pagenumber
      set continue numbering of section 1 to true
      end tell –theDoc

      — INSERT NEW “DISPLAY AD” PAGES
      tell theDoc
      set originalPgCount to count of pages
      set myPageNames to get id of every page as list
      repeat with eachItem in myPageNames
      make new page at after page id eachItem with properties {applied master:master spread myMasterChoice, allow page shuffle:true}
      end repeat

      –SET GUIDES TO TOP
      set properties of the guide preferences to {guides in back:false, guides locked:false, guides shown:true, guides snapto:true, ruler guides color:cyan, ruler guides view threshold:5.0}

      end tell –theDoc
      end tell –application
      tell current application to beep 2

Viewing 1 reply thread
  • You must be logged in to reply to this topic.
Forum Ads