3 Replies Latest reply on Jul 18, 2011 7:19 PM by John Hawkinson

    Parent Character from Inline/Anchored frame


      I'm working in CS5 with javascript trying to access the parent character that holds an inline/anchored frame from the inline/anchored frame. All the scripts I have found work in the other direction.

        • 1. Re: Parent Character from Inline/Anchored frame
          Dirk Becker Level 4

          The parent character *is* the parent!




          => [object Character]




          => 65532



          • 2. Re: Parent Character from Inline/Anchored frame
            CHM_Kathy Level 1

            Thanks Dirk - you saved me a lot of aggrevation.


            Because I'm using a findGrep I can't use item() with the parentTextFrames[0] returned from the find.

            Instead I grabbed the textFrame id and access the textFrame via itemByID. I'd love to know if there is anyother way to do this. Seems rather twisted.


            for(j=0;  found_items.length > j;  j++)


                    var anchorID = found_items[j].parentTextFrames[0].id;
                    linkChar = app.activeDocument.textFrames.itemByID (anchorID).parent.contents.charCodeAt(0);


            • 3. Re: Parent Character from Inline/Anchored frame
              John Hawkinson Level 5

              Err...are you aware that

              parentTextFrames[0] is the same as


              Dirk likes to use the .item() notation because it can help to distinguish arrays from Javascript plural objects/collections. I like the [] notation because it's shorter and more succinct to me.

              (also, you realize that, in your snippet, everything is a global variable except for anchorID?).


              Can't you just write


              var linkChar =