2 Replies Latest reply on Feb 2, 2012 12:11 PM by JonnyDL

    Border on selected rectangle?

    JonnyDL Level 1

      I have a document that will have allot of rectangles in it. I would like to only select one, and put a border on that. I can get the script to work the border/stroke.

      but I can't figure out how to get it to use the rectangleI have selected.

       

      I've tried active and selected but they give me an error.

       

      Is there a way to do this

       

      tell application "Adobe InDesign CS5"

                tell rectangle 1 of document 1

                          set stroke color to "Black"

                          set stroke tint to 100

                          set stroke weight to 1

                          set stroke alignment to outside alignment

                end tell

      end tell

        • 1. Re: Border on selected rectangle?
          Muppet Mark Level 5

          The document selection can return you a list or nothing so you want to do something like…

           

          tell application "Adobe InDesign CS5"

          activate

          tell document 1

          if (count of every item of selection) = 1 then

          if (class of first item of selection) = rectangle then

          tell selection

          set stroke color to "Black"

          set stroke tint to 100

          set stroke weight to 1

          set stroke alignment to outside alignment

          end tell

          end if

          end if

          end tell

          end tell

          • 2. Re: Border on selected rectangle?
            JonnyDL Level 1

            Thanks!

            Never thought of using the selection like that.

            and the further checking if its a rectangle is a nice touch

             

            I appreciate the help