1 Reply Latest reply on Aug 4, 2009 5:13 PM by sstanleyau

    [as] [cs3] Paste into, "All page items"

    sam452sam452

      I'm trying to automate the act of pasting a text frame into a picture frame. Reading the properties of one created manually, I see that the new frame is a child of the picture frame, which is a child of the insertion point where I have an anchor in the text (for inline text). FYI, the picture frame has a newly created object style applied to it that is custom.

       

      Here's my attempt. It runs without error but there is no text frame found in the document that has the contents denoted:

       

      tell application "Adobe InDesign CS3"

      tell document 1

      set textObj to object reference of selection

      tell beginning of textObj

      set mySigBox1 to make rectangle with properties: {set geometric bounds{4.5, 2.5, 5.5, 7.5}}

      end tell --textObj

      tell all page items of mySigBox1

                          make rectangle with properties {content type:text type, contents:"Fred"), anchored object settings:anchored object settings of mySigBox1, parent:mySigBox1, geometric bounds:{4.25, 2.5, 5.25, 7.25}}

                     end tell -- all page items

      end tell --doc1

      end tell --app

       

      Reading the Adobe Scripting Guide I see that the parent should actually be the insertion point where the anchor is. But it's not clear to me how to address that so that it knows where everything falls.

       

      Pointers would be appreciated, thanx, sam