1 Reply Latest reply on Oct 17, 2010 3:58 PM by Colin Flashman

    [JS][CS3-CS5] anchored objects/inline back to text

    Colin Flashman Adobe Community Professional

      g'day there.


      been handed a reformatting job where the client has supplied text in word with additional textframes (they have made callouts next to their body text), meaning when the text is imported into indesign, the text has hundreds of anchored objects containing the callouts. is it possible to take these anchored objects and convert them back into the actual main textframe? ATM, the only way to do this would be to cut and paste.


      i have done a search on the forums and elsewhere to remedy this and there are plenty of threads advising on how to take text and make anchored objects out of them, but what i want to do is the reverse.


      thank you.



        • 1. Re: [JS][CS3-CS5] anchored objects/inline back to text
          Colin Flashman Adobe Community Professional

          i feel strange answering my own question, but i stumbled across this older applescript and it seemed to do the trick, so thought i'd put it out there.


          tell application "InDesign CS5"
              tell document 1
                set thetextframes to text frames
                repeat with aframe in thetextframes
                   set theCount to count of (text frames of aframe)
                   tell aframe
                       repeat with i from theCount to 1 by -1
                         set boxContents to paragraphs of text frame i of aframe as string
                         set contents of first insertion point of parent of text frame i to boxContents
                         delete text frame i of aframe
                       end repeat
                   end tell
                end repeat
             end tell
          end tell


          full credit to peter kincaid who wrote the script. all i did to make it work was just to tell the application CS5 rather than CS1 which was in the original script.


          the actual site i found the script at was: