3 Replies Latest reply on Jul 30, 2008 2:56 PM by sstanleyau

    [CS3] [AS] Text formatting

      I'm trying to create a new InDesign document, make a text box the size of the document and insert some text. It all works until I try to add some formatting/style changes to the text being inserted. I'm sure it's just syntax as it (different than below) worked in CS2, but not in CS3. I get an error message stating that the font can't be applied. I want to apply a font, font size, alignment and text frame stroke. Here's most of the code (variables are defined earlier):

      tell application "Adobe InDesign CS3"
      set myDoc to make document with properties {document preferences:{page width:AdHoriz, page height:AdVert}}
      tell view preferences of myDoc
      set horizontal measurement units to inches
      set vertical measurement units to inches
      set ruler origin to page origin
      end tell
      
 tell myDoc
      set myTextFrame to make text frame
      set geometric bounds of myTextFrame to {0,0,AdVert,AdHoriz}

      set applied font of myTextFrame to "Helvetica"
      set point size of myTextFrame to "8"
      set justification of myTextFrame to center align
      set stroke weight of myTextFrame to "4"

      set contents of myTextFrame to return & Company & return & AdSize & return & Adnumber

      end tell
      end tell

      I'm on a Mac, OSX Tiger. Thanks for any help!
        • 1. Re: [CS3] [AS] Text formatting
          sstanleyau Level 4
          You ned to style the text, not the frame. So:<br /><br />    set applied font of parent story of myTextFrame to "Helvetica"<br /><br />etc,<br /><br /><br />-- <br />Shane Stanley <sstanley@myriad-com.com.au>
          • 2. Re: [CS3] [AS] Text formatting
            Level 1
            Shane, thanks for your input! I tried this on all four styles. The font, size & alignment all work but the stroke weight doesn't:

            set applied font of parent story of myTextFrame to "Helvetica"
            set point size of parent story of myTextFrame to "18"
            set justification of parent story of myTextFrame to center align
            set stroke weight of parent story of myTextFrame to "4"

            I also tried the stroke weight without "parent story" thinking it would apply to the frame, but no go.

            Thank you!
            • 3. Re: [CS3] [AS] Text formatting
              sstanleyau Level 4
              On 31/7/08 2:41 AM, "Mike Guyette" <member@adobeforums.com> wrote:<br /><br />> The font, size & alignment all work but the stroke weight doesn't:<br /><br />I suspect it is working, but you won't see anything unless you also change<br />the color of the stroke. Try something like this:<br /><br />        set stroke color of parent story of myTextFrame to "Black"<br />        set stroke weight of parent story of myTextFrame to 4<br /><br />-- <br />Shane Stanley <sstanley@myriad-com.com.au>