4 Replies Latest reply on Jul 27, 2011 3:38 PM by Mary Posner

    InDesign and Applescript - Another place asset question.

    JJ0330 Level 1

      I am trying to place an asset on page but am having some problems.  If I have an asset in my library and it has a few items in like a couple text boxes and images and they are grouped together, it places fine but then I have a problem with trying to change styles for any individual items withing that asset because seems to treat group as item 1 of that asset and can't seem to get to reference individual items of asset that has grouped items.  Tried things like "item 1 of placed asset" but treats that like group which is good for move but not when wanting to reference individual items.  When I create placed asset with all individual items ungrouped then it does allow me to apply styles on individual items but then can't move everything to location as a group so allignment all stays correct.  Thinking that maybe I could either ungroup all items in first scenerio after moving then apply styles but not sure how to refernence that group and then the items within that group when ungrouped.  Or, doing second scenerio where load asset ungrouped then apply styles then group and move but since number of items in assets can be different, not sure how to dynamically create group using repeat or something?  Thanks, Joe


                   repeat with i from 1 to count csvEntries

                          set csvEntry to csvEntries's item i

                          set {fldElement, fldLocationX, fldLocationY} to csvEntry's text items

                          set placedAsset to place asset asset fldElement of library "GTElements.indl" on myDocument

                              move placedAsset to {fldLocationX, fldLocationY}


                          -- apply styles to individual items os asset

                          -- Then, can I create group dynamically for all items in asset if ungrouped?

                          -- set myGroup to make group with properties {group items:{ placedAsset}}???

                          -- then move group to location?

                          -- Or

                          -- can I ungroup asset if comes in already with all items grouped

                          - First, move to location everything as a group then ungroup

                          --    tell placedAsset

                          --           ungroup

                          --    end tell

                          -- Now apply styles to individual items.