1 Reply Latest reply on Apr 16, 2010 7:38 PM by Stephen Horne

    specifying objects based on applied paragraph styles

    Stephen Horne

      Hi, can anyone tell me where I'm going wrong with this? I want to set the bounds of a load of text frames scattered through a document to specific values, identifying them by the paragraph style applied to their (only) paragraph.

       

       

      tell application "Adobe InDesign CS3"

           tell document 1

                set geometric bounds of ¬

                every text frame of document 1 ¬

                whose applied paragraph style of paragraphs is "Crag Intros Left" to {3.880555555556, 6.99999800788, 10.0, 139.347222222222}

           end tell

      end tell

       

       

      it generates this error message:

       

      Adobe InDesign CS3 got an error: Can’t set geometric bounds of every text frame of selection of document 1 whose .....

       

      Thanks

        • 1. Re: specifying objects based on applied paragraph styles
          Stephen Horne Level 1

          I've figured it out. The important part was to specify "name of applied paragraph style". I also use a repeat statement instead of telling the document to change everything in one go:

           

          tell document 1

               repeat with oneFrame in (get text frames whose name of applied paragraph style of paragraphs is "Crag Headings Left")

                    if geometric bounds of oneFrame is not {a, b, c, d} then

                         set geometric bounds of oneFrame to {a, b, c, d}

                    end if

               end repeat

          end tell