2 Replies Latest reply on Dec 8, 2014 1:51 PM by BSAphex

    layer hierarchy?

    BSAphex

      Hi all,

      I can't figure out how to change the layer order of my current script.

      Basically, the script creates a box with an outline (rule) onto a new layer, but this new layer sometimes ends up being created below other layers which obscure it.

      Is there a way to make this new layer always be the topmost layer?

       

      Here is the current script:

       

      tell application "Adobe InDesign CS6"

        if (count documents) is not equal to 0 then

        --get the number of pages, page height and page witdth

        set pageCount to the number of pages of active document

        set pHeight to page height of document preferences of active document

        set pWidth to page width of document preferences of active document

        --calculate the witdht of the spread by the product of page width and page count

        set boxWidth to (pWidth * pageCount)

        --make a transparent rect with 1pt stroke around the spread

        tell active document

        set zero point to {0, 0}

        make new layer

        make new rectangle with properties {geometric bounds:{0, 0, pHeight, boxWidth}, fill color:"None", stroke weight:0.5, stroke color:"Registration", stroke alignment:inside alignment}

        end tell

        end if

      end tell

       

       

      Any advice would be greatly appreciated.

      Thanks,
      Dennis

        • 1. Re: layer hierarchy?
          greenrookie Level 2

          Hi BSAphex,

           

          Try replacing this part.

           

           

              tell active document

                 set zero point to {0, 0}

                 set myNewLayer to make new layer with properties {name:"TOP LAYER"}

                 tell myNewLayer

                      move to beginning of layers of active document

                  end tell

                 make new rectangle with properties {geometric bounds:{0, 0, 21, 21}, fill color:"None", stroke weight:0.5, stroke color:"Registration", stroke alignment:inside alignment}

           

          end tell

           

          greenrookie

          • 2. Re: layer hierarchy?
            BSAphex Level 1

            Thanks, greenrookie.

            That did the trick. I just put my geometric bounds back to the original settings in my script and everything is working great now.

            Thanks very much for the help.