Skip to main content
Colin Flashman
Community Expert
Community Expert
October 17, 2010
Question

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

  • October 17, 2010
  • 1 reply
  • 480 views

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.

colly

This topic has been closed for replies.

1 reply

Colin Flashman
Community Expert
Community Expert
October 17, 2010

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:

http://olivier.berquin.free.fr/indesign/indesign_cs1.html

If the answer wasn't in my post, perhaps it might be on my blog at colecandoo!