1 Reply Latest reply on Dec 11, 2008 11:06 AM by (Olav_Kvern)

    CS4 VBS Groups

    Samuli75 Level 1
      I have selected a group, which first object's text color I would like to change as black. How do I refer to group's first object?

      Following works with normal text objects, but not with groups.

      Set myInDesign = CreateObject("InDesign.Application")
      Set myText = myInDesign.Selection.Item(1).Texts.Item(1)
      Set myDocument = myInDesign.Documents.Item(1)
      myText.FillColor = myDocument.Colors.Item("Black")
        • 1. Re: CS4 VBS Groups
          Level 1
          Hi Samuli Seppala,

          Instead of:

          Set myText = myInDesign.Selection.Item(1).Texts.Item(1)
          

          Use:
          Set myTextFrame = myInDesign.Selection.Item(1).TextFrames.Item(1)
          
          Set myText = myTextFrame.Texts.Item(1)

          The objects inside a group are page items--Text is not a page item, but TextFrame is. If you look at the Group object, you'll see that it can contain TextFrames, but not Texts.

          Thanks,

          Ole