2 Replies Latest reply on Jun 20, 2014 3:16 PM by nellbern

    unlock-delete-create guides on master pages

    nellbern

      Im having issues with code below. I inherited the previous designer documents  would like to unlock, delete & create margins to the master pages. I'm no an expert but knows a little bit.

       

       

      tell application "Adobe InDesign CS4"

        activate

        set myDocument to document 1

        tell view preferences of active document

       

        --Set horizontal and vertical measurement units to inches.

        set ruler origin to page origin

        set horizontal measurement units to inches

        set vertical measurement units to inches

        end tell

       

        --change margins of the master spread

        set myMasterSpread to master spread 1 of myDocument

        tell margin preferences of page 1 of myMasterSpread

        -- page margins and columns.

        set left to ".5" --outside

        set top to ".5 in"

        set right to ".75 in" --inside

        set bottom to ".75 in"

        end tell

      --Page margins right  master page

        tell margin preferences of page 2 of myMasterSpread

        set left to ".5" --inside

        set top to ".5 in"

        set right to ".75 in" --outside

        set bottom to ".5 in"

        end tell


        --create guides on master pages 1 & 2

        --** currently not working

        set myMasterSpread to master spread 1 of myDocument

        tell guide preferences of page 1 of myMasterSpread

        set guides locked to false

        set ruler guides color to orange

       

        --tell page 1 of myDocument

        delete guides

        make guide with properties {orientation:vertical, location:".25"}

        make guide with properties {orientation:vertical, location:"7.6875"}

        make guide with properties {orientation:horizontal, location:".25"}

        make guide with properties {orientation:horizontal, location:"10.25"}

        --end tell

       

        tell guide preferences of page 2 of myMasterSpread

        delete guides

        make guide with properties {orientation:vertical, location:".25"}

        make guide with properties {orientation:vertical, location:"7.6875"}

        make guide with properties {orientation:horizontal, location:".25"}

        make guide with properties {orientation:horizontal, location:"10.25"}

        end tell

      end tell

      end tell

        • 1. Re: unlock-delete-create guides on master pages
          Mary Posner Level 3

          Guide preferences are set at the document level, not at pages or spreads. You need to address the page, rather than the guide preferences of the page, to make guides. Try this:

           

            tell guide preferences of myDocument

              set guides locked to false

              set ruler guides color to orange

            end tell

           

            tell page 1 of myMasterSpread

              delete guides

              make guide with properties {orientation:vertical, location:".25"}

              make guide with properties {orientation:vertical, location:"7.6875"}

              make guide with properties {orientation:horizontal, location:".25"}

              make guide with properties {orientation:horizontal, location:"10.25"}

            end tell

           

          Lather, rinse, repeat for page 2 of the master spread. BTW, you can remove the "set myMasterSpread" line from under "--** currently not working" line. You already set that towards the top of the script.

           

          Hope that works for you.