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

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

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

Similar Messages

  • CS3 - Auto Anchored objects

    Hi all,
    I would like to speed up my workflow enormously. I have a very repetitive thing that I need to speed up somehow...
    I receive supplied text that requires formatting. I have just about everything automated except inserting graphics into certain locations. I currently insert an object as an anchored object one by one wherever it needs to be put..
    The things is, all the graphic objects are identical (the exact same file), and they appear hundreds of time throughout the document.
    The objects are to all behave exactly the same way so a style could be set up - it's just the matter of placing the object hundreds of times every time I get new text to update the file with. So at the moment, I am spending way way way too much time individually placing each object one by one.
    I'm not a highly experienced ID user, so I'm hoping I'm just missing something here. I've scoured tutorials and help and the web to no avail. Hence my post here.
    Currently, they put the text code "grphc" where they want the little picture in the text supplied to me. I then do a search for "grphc" in the find function. It finds it, I then select this code and place the inline object. I then go back to the find function to show me the next code. It takes me straight to it, I then repeat the process of selecting the text code, place the object, find the next code, select the code, place the object, find the next code, select the text, place the object, find the next code, select it, place the thing, find the next, select it, place it... and so on and so on till my brain hurts through a very very repetitive operation. It hurts!.
    Please help me automate this very time consuming and brain numbing repetitive action...
    Like I said, I'm not a heavily experienced user of InDesign, so I'm hoping that I am simply missing something. (I can only hope)
    I'm hoping that a very easy, almost 'one click' fix can replace the special code with this little grpahic.
    I mean, I can find all occurrences of a given text in the document and replace it all in one hit with some other text, but it seems to not allow to replace text with a graphic.
    please help. even if the answer is in front of my face & cannot see it..
    Thanks very much in advance.
    Graeme.

    WOW!!!,
    Thankyou Dave, that works a treat.
    I must admit though, I am surprised that with the amount of power ID has with this Find/Replace function that it doesn't have the ability to find and replace with a graphic.
    Maybe I should put a wish list to ID to add this find text and replace with an object feature...
    Graeme.

  • [JS CS3] Releasing Anchored Objects

    Hello,
    The following script places a libray item as an anchored object...
    var myDoc = app.documents[0];
    var myFrame = app.documents[0].textFrames.item("myTarget");
    var myInsertPoint=myFrame.parentStory.paragraphs.item(0).insertionPoints.item(0)
    var myLibraryItem=app.libraries[0].assets[0]; myFrame=myLibraryItem.placeAsset(myInsertPoint);
    with(myFrame[0].anchoredObjectSettings){
    anchoredPosition = AnchorPosition.anchored;
    anchorPoint = AnchorPoint.topLeftAnchor;
    horizontalReferencePoint = AnchoredRelativeTo.anchorLocation;
    horizontalAlignment = HorizontalAlignment.leftAlign;
    anchorXoffset = 0;
    anchorYoffset = 0;
    How do I now release my anchored library item and then send it behind the text in the text frame "myTarget" ?
    Thanks
    Simon Kemp

    Thanks Harbs, this has made things simpler.
    I have heard your name mentioned several times today in the InDesign Secrets podcast (and Dave's too).
    I am almost there with the script (my scripting is clumsy but I can usually get things to work mainly with help from this forum.
    My last problem is that I am re-applying geometric bounds to the released anchored object as it is still being referenced as myAnchoredFrame.
    Is it possible to release ALL the anchored objects in one go? Or how do I dump the reference to myAnchoredFrame once it has been released?
    var myTextFrame = app.documents[0].textFrames.item("myTarget");
    var myParagraphs = myTextFrame.paragraphs
    for (var i = 0; i <= myParagraphs.length-1; i++) {
    var nLines = myParagraphs.item(i).lines.length;
    var myAnchoredFrame = myTextFrame.paragraphs.item(i).insertionPoints.item(0).textFrames.add();
    var myHeight = nLines*myParagraphs[i].leading*.353
    myAnchoredFrame.geometricBounds = [0, 0, myHeight, (myTextFrame.geometricBounds[3]-myTextFrame.geometricBounds[1])];
    myAnchoredFrame.fillColor = "Gradient";
    myAnchoredFrame.gradientFillAngle = 90;
    myTextFrame.texts.item(0).recompose;
    with(myAnchoredFrame.anchoredObjectSettings){
    anchoredPosition = AnchorPosition.anchored;
    anchorPoint = AnchorPoint.topLeftAnchor;
    horizontalReferencePoint = AnchoredRelativeTo.anchorLocation;
    horizontalAlignment = HorizontalAlignment.leftAlign;
    verticalReferencePoint = VerticallyRelativeTo.capheight;
    verticalAlignment = VerticalAlignment.topAlign;
    anchorXoffset = 0;
    anchorYoffset = -1;
    pinPosition = false
    myAnchoredFrame.anchoredObjectSettings.releaseAnchoredObject ()
    myAnchoredFrame.sendToBack();
    Thanks again
    Simon Kemp

  • Can't anchor object at top of text frame

    I'm trying to place an achored object inline at the top of a text frame (CS 5). If I make the insertion point before the first word of text the object always gets placed below the first line of text. I can change the Y relative to "Line (top of leading)" for the anchored position in the options but then the first line of text gets covered up (the object has text wrap applied). I can put an extra space at the top of the page and anchor the object there, but then the text doesn't begin at the top of the text frame.

    Here's a shot of the page and the anchored object settings. The arrow points to the insertion point in the text frame.

  • Need anchored objects to be behind text

    Anchored objects have aways had lot of shortcomings for my workflow. One shortcoming I'd really like to see fixed in future versions of ID is the inability to choose for the anchored object to appear behind the text it is anchored with. Here are just a few uses that I can think of that would be helpful in my workflow:
    Creating numbered lists that have specialty art behind the numbers. To do this currently, you have to either do manual numbering and group it with each object and anchor the object with the number into the line of text or you have to keep the auto-number list and the objects for the numbers separate and manually reposition the number objects whenever the text reflows.
    Creating paragraph backgrounds that flow with the paragraph. Right now about the only way to do that is using the paragraph rules or tables which have severe formatting limitations (no rounded corners, ignore text wrap, etc.), and the rules are difficult to resize. If you could create the background as a ID object or placed art and anchor it to the beginning or end of the paragraph, you could manually resize it to the size of the paragraph and it will flow with the paragraph whereever you need it (this currently will not work unless the object can be made transparent to the text using an effect.
    Captioning anchored images could actually overlap the image if and where necessary. Right now, if you want captions to appear on top of an anchored image, you have to group the caption with the image before anchoring it into the text flow.
    There are workarounds obviously for these tasks (as I've indicated), but by their nature workarounds are time consuming. I'm always looking for ways to automate tasks and save time in ID. Having the option to make an object appear behind the text it is anchored with would be a tremendous time saver.
    Anyone else see a use for stacking order option with anchored objects?

    @Obi-wan – you say: "Despite the fact that, like all anchored boxes, it is foreground, text color is truly visible with no effect on the blue block !!"
    With anchoring "Above Line" the anchored objects are really stacked behind. At least that stacking order is true for all characters after the anchor character. Using a different anchoring method will always yield in anchored objects stacked above (foreground).
    Doing some tricks with the effects panel on the anchored object is alright, so that all the other text, that is stacked below will showing through, but you should be aware, that these effects will change the game when it comes to color separation for print workflows.
    Separation preview with all channels visible CMYK:
    Separation preview with [Black] not visible CMY:
    As you can see, the usually overprinting color [Black] on the text below is left out. When exporting a PDF, I think nearly no prepress tool in the world will find an automatic way to change this because of the stacking order of the elements.
    If the green rectangle would be stacked behind the text like in anchoring "Above Line" we will see the following with separation preview CMYK:
    Turn off K in the separation preview will give a surprising image:
    All black text, that comes after the anchor character will overprint, all text before will not. And that "will not" is definitive. If we look at the objects in Acrobat Pro after exporting to PDF, we will see that not overprinting characters "ut endis" in my little screenshot here are below the green rectangle, all characters following after the anchor are above the green rectangle.
    Here a screen shot from Acrobat Pro that will reveal the stacking order a bit (the transparent background of the page is shown as gray; an option in Acrobat Pro's view preferences):
    So in the end, "ut endis" will be printed with a total amount of color:
    0 Cyan
    0 Magenta
    0 Yellow
    100 Black
    Sum: 100%
    The "black" text following due to overprinting* (EDIT) will be printed with:
    75 Cyan
    5 Magenta
    100 Yellow
    100 Black
    Sum: 280%
    * AND of stacking order of course!
    All other black text will overprint as well, but there is no effect for the green rectangle because the text is stacked behind the rectangle.
    Uwe

  • Sending anchored objects to back (Indesign CS3)

    I would like to create a graphic, make it inline, move it over type and send to back so that the type appears on top.
    No problem until I anchor it.
    Thanks for any help.

    Can it be done this way, if so what is the correct syntax. If not than I'm clueless on how to do it. so some help would be greatly appreciated.No it cant, but why?
    If any additional info is needed just post and I'll get it to you!What problems have you encountered with the code you are trying? Any errors you want to share?
    Also, 1 of the reason to why it wont work is because your method dealCard(), doesnt return anything, so how do you expect to add that to and ArrayList?
    There are other faults that can be spotted as well. But you need to post an complete runnable program, that you can work with and share. Just showing this little code, without any error messages, aint gonna help much in localizing the errors and faults in the code.
    Edited by: prigas on Apr 18, 2009 1:40 PM <-- Needs a spelling course.

  • At my wits end: Placing anchored object inline with text & wrap

    Granted I never learned InDesign the way I should.  Once upon a time I fared well with Aldus Pagemaker.  But I've just spent the last two hours trying to resolve a massive gap in my knowledge and I can't do it.  I'm exasperated and desperate for help.
    What I want to do:  I have a tech manual with lots of text and need to place graphic objects in a way that the text will wrap around the object and if I need to edit the text, the graphic will move with where I inserted the graphic.
    What happens:
    1.  I have a text frame with text.  I place the cursor at the beginning of the paragraph and click File> Place, thereafter choosing a graphic.
    2.  Using the selection tool, I click the graphic and then click the icon "wrap around bounding box".
    3.  The text shifts a teeny bit but does not wrap around the object.
    4.  Object is, however, inline/anchored, with text.
    OR
    1.  With nothing selected I click File> Place, thereafter choosing  a graphic.
    2.  I place the graphic on the lower part of the page over a blank space.
    3.  I move the graphic over the text and then click the icon "wrap around bounding box".
    4.  The text flows but when I edit the text, it does not flow around the graphic.
    Conclusion:
    I am retarded.  I even went through Lynda's example here:  http://www.adobe.com/designcenter/video_workshop/?id=vid0073   I was able to place my object in her document and watch the text flow around the text wrapped graphic.
    I read the help docs (I'm a big fan of reading).
    The only thing I can think of is I've set my text box up wrong or I have no idea.  I'm so frustrated I am seriously almost in tears.
    My example document (I'm under an NDA and can't release my original document, but I duplicated what I've done in the previous one) is here for anyone who can tell me what I've done wrong.  Thank you kindly.
    http://www.xandria.ca/test01.indd

    Alrighty, this is bizarre.  I couldn't leave well enough alone and I'm still trying to hammer this one out.  But I just followed my first method described in the original message and then...
    I clicked and dragged the edge of my graphic and the text began to flow around it and it moves with the text.
    What on earth?
    While I can do this for each image, I'd rather not.  What am I still doing wrong, although I seem to have a half baked workaround.
    Cheers.

  • InDesign CS5: Anchored Objects

    I have a 30 page document that is flowing text and images. At this point the images are NOT anchored to the text boxes so that they flow with the text. I know you can cut/copy and paste them into the text box individually. I have 27 images that need to be inserted. Is there a way I can anchor these images all at once? Or do I have to anchor each one individually?

    Correct, they currently only have a location on the page, not within the text. I guess we'll have to wait until we update our CS version to advance this step.
    Also, can I anchor an image while I'm placing it? Or do I have to place it, then cut/copy inorder to anchor it within the text box?

  • Anchored objects disappeared

    My anchored objects inserted into text have all disappeared. All layers are on. The text is there but the objects are not. How can I get them back?

    All layers are on
    @Annie – this is not relevant, because anchored objects ("inline" or "custom" makes no difference) are tied to the layer of their parent text frame.
    1. The objects could be "hidden".
    There is a contriol for that to bring back all hidden objects on a spread:
    alt + cmd + 3 (for InDesign on Mac OSX)
    2. The objects could be set to "No Printing" and you look at your document with the "View / Overprint Preview" checked. You can control the "No Printing" in the Attributes Panel.
    3. A combination of 1. and 2.
    4. The objects are removed…
    Could happen with a TEXT or GREP search/replace action that happens to include all anchor characters in your text.
    5. …
    Uwe

  • Easier anchored objects

    I think it would be great if anchor points were easier to use.  I know how to create an anchored object, but I don't usually because they are a hassle.  It would be much easier if anchor points could be added to objects that are already there.  Also when I use text wrapping with an anchored graphic, it does not always work, depending on the vertical alignment with the anchor point.

    All layers are on
    @Annie – this is not relevant, because anchored objects ("inline" or "custom" makes no difference) are tied to the layer of their parent text frame.
    1. The objects could be "hidden".
    There is a contriol for that to bring back all hidden objects on a spread:
    alt + cmd + 3 (for InDesign on Mac OSX)
    2. The objects could be set to "No Printing" and you look at your document with the "View / Overprint Preview" checked. You can control the "No Printing" in the Attributes Panel.
    3. A combination of 1. and 2.
    4. The objects are removed…
    Could happen with a TEXT or GREP search/replace action that happens to include all anchor characters in your text.
    5. …
    Uwe

  • GREPFind/Replace Anchored Objects

    I'm trying to use Find/Replace to automatically remove all the EMPTY anchored objects from my document.
    First, I use Data Merge to Create Merged Document, then run a series of Find/Replace actions to clean up hidden paragraph markers and the like. But there are some Anchored Objects that do not contain links which I need to have removed.
    I've created a script for the series of actions, but everything I try for the anchored objects simply removes all of them.

    All layers are on
    @Annie – this is not relevant, because anchored objects ("inline" or "custom" makes no difference) are tied to the layer of their parent text frame.
    1. The objects could be "hidden".
    There is a contriol for that to bring back all hidden objects on a spread:
    alt + cmd + 3 (for InDesign on Mac OSX)
    2. The objects could be set to "No Printing" and you look at your document with the "View / Overprint Preview" checked. You can control the "No Printing" in the Attributes Panel.
    3. A combination of 1. and 2.
    4. The objects are removed…
    Could happen with a TEXT or GREP search/replace action that happens to include all anchor characters in your text.
    5. …
    Uwe

  • New technique to place multiple anchored objects in InDesign story

    Hello,
    For a while I have been trying to figure out how to insert multiple anchored objects into an Indesign story. As far as I can tell, you cannot copy multiple objects that have already been placed in a document (such as a multi-page pdf) into an InDesign story, but must copy and paste them one-by-one into the story. This is a problem for a project I am working on where I want to have a large number of 340x52 pt pdfs to flow throughout a document in a master text frame interspersed with text.
    I have now found a solution for this issue that I thought I would share in case it would be helpful for anyone. It utilizes Automator actions for Mac OS X and Microsoft Word 2011 [2008 may work also, but I don't have a copy of that to test]; I am not good with scripting but perhaps similar solutions could be found for other systems and programs.
    1. If you want to place a multipage pdf within a text frame, first it into individual files for each page (with Acrobat Pro or pdftk or something similiar).
    2. Create an Automator service or program with the action "Create New Word Document". You can also use another automator action to save the document, or save it manually (to change the filename). In the finder, select the items you want, then run the service or drag them into the Automator program you have created.
    3. Place the word document into your InDesign story. Your items will now be anchored objects ordered in your text frame as they were in the finder.
    Please let me know if this is helpful or if anyone has suggestions for doing this process is a more efficient way. I am not sure, but it may be the case that this approach would only work on Macs, as I gather from this thread.

    I might note that I am using InDesign CS 5, and importing from a document stored in docx format.

  • Place anchor image by finding the text...

    Hi scripting Gurus & everyone,
    We are working with InDesign CS3 files. And we need to place two different icons as anchor objects in the margins by finding respective callouts. If the callout is "[Pair-Icon]" means the P-icon (i.e. image) that has to be placed as anchored object. If the callout is "[Group-Icon]" means the G-icon (i.e. image) that has to be placed as anchored object. The icons have approximately 3 pica height and width. It will always comes in left side of the margin in both verso and recto pages. Doing automation for anchor object placements is new to us.
    Can any one help me for this.
    Thanks in advance.
    Thiyagu

    Hi scripting gurus,
    I have tried a little bit to place the "Pair_Icon" art as anchor object by replacing the text "[P-ICON]" in the document. But nothing happened after running the script. Same like the Group_Icon has to be placed by replacing the text "[G-ICON]. Can anyone look into this help me out.
    Find the script below,
    //===================
    if(app.documents.length>0)
        var myDoc=app.activeDocument;
        var myText=["[P-ICON]"];
        var myText1=["[G-ICON]"];
         var Lb1=["Group_Icon"];
        var Lb2=["Pair_Icon"];
        var counter=0;
        var Xoffset=63;
        var Yoffset=4;
        var Dist=12;
        var myNewUnits = myDoc.viewPreferences;
        myNewUnits.verticalMeasurementUnits = MeasurementUnits.points;
        myNewUnits.horizontalMeasurementUnits = MeasurementUnits.points;
        myNewUnits.rulerOrigin=RulerOrigin.pageOrigin;
        myDoc.zeroPoint=[0,0];
        for(var j=0;j<myText.length;j++)
            for(var i=myDoc.stories.length-1;i>=0;i--)
                var Stry=myDoc.stories[i];
                var Para=Stry.contents;
                for(var k=0;k<Para.length;k++)
                    try{
                        if(Para[k]==myText)
                            app.selection=1851876449;
                            Para[k].select();
                            app.selection=1851876449;
                            var y=app.libraries[0].assets;
                            var Chi=Lb1[j];
                            var x=y.item(Chi).placeAsset(myDoc);
                            Tex=x[0];
                            Tex.contents="A";
                            Tex.contents.select();
                            app.paste();
                            var RemLen=Tex.characters.length;
                            Tex.characters[RemLen-1].remove();
                            Tex.fit(FitOptions.frameToContent);
                            var Obj=Para[k].pageItems[0];
                            Obj.anchoredObjectSettings.anchoredPosition = AnchorPosition.anchored;
                            Obj.anchoredObjectSettings.spineRelative=true;
                            Obj.anchoredObjectSettings.anchorPoint = AnchorPoint.topLeftAnchor;
                            Obj.anchoredObjectSettings.horizontalReferencePoint=AnchoredRelativeTo.pageMargins;
                            Obj.anchoredObjectSettings.anchorXoffset=0;
                            Obj.anchoredObjectSettings.anchorYoffset=0;
                            Obj.anchoredObjectSettings.verticalReferencePoint=VerticallyRelativeTo.capheight;
                            counter++;           
                    catch(e)
                        alert(e);
        alert(counter+" DONE");
    //=======================
    Thanks in advance
    Thiyagu

  • My anchored objects dont display after CS5 upgrade - help?

    Hi,
    We've just upgraded to CS5 from CS3.
    I publish educational books, which contain a lot of object styles and anchored objects.
    I have just opend a book im working on in CS5 and have had problems with both anchored objects not displaying and object styles changing. The first is more pressing.
    The problem arises where I have an anchored object inside another anchored object, and they use custom positioning.
    For example. I have a pullout box that contains text and an image. The image is anchored inside the pullout box and the pullout box is anchored to the main body of text.
    The images are no longer displaying. I can select their frames, and if i change the image positioning to inline the images display fine, but when it is set to custom (which they need to be) I can no longer see the image.
    Is anyone able to help with this, its a major problem as i am woking with hundreds of images here.
    Thanks

    My usual advice is that with a project this large, it's best to finish it in the same version it was started in. Even a small change in the text engine can effect things like this and there were changes from CS3 to CS4 and again to CS5, but I'm not really sure what's happening in your case.
    Bob

  • Anchored objects and first line in InDesign CS3

    Hi, thanks for reading. I know that when you want an achored object at the beginning of a text block to all push away ("wrap around") the text, including the first line, you have to put it into a line before that.
    What I don't like about it, is that I then have an empty first line and everything else is pushed one line down. Now I could move the whole textbox up, to fit to the rest of my layout, but that's not the way one should work in InDesign. Is there a way to get around the first line?

    T-
    Select the anchored object and put text wrap on it. Then select the anchored object and go to Object/Anchored Object/Options. Select Position: Inline and set the Y Offset to the negative number that aligns your text where you want it.

Maybe you are looking for

  • Sybase ODBC driver for Linux - handle of numeric data type is not correctly

    Linux RHEL 4 + Oracle 10.2.0.3 - all work fine. But numeric data type does not coorectly show values. I gor driver from ASE 15. Who has already resolve this issue???

  • Hdmi option not shown in preferences

    hdmi option not shown in preferences

  • Curve 8520 browser. Pls help

    I recently  inherited a curve 8520 (v4.6.1.286 [Platform 4.2.0.122]and deleted only the facebook and yahoo messenger apps. Now,when using wi-fi, I cannot browse the internet. it says "Invalid address" all the time whatever website i browse.  Pls help

  • ITunes 7:  Single Library, Multiple Users

    iTunes 7; Can I have a sinlge library that is accessed by multiple instances of iTunes? For example, if I have a network attached storage device or file server where all of the media files are stored, can I have multiple instances of iTunes on multip

  • Patchsvr is not able to download patches

    Solaris 10 8/07 s10x_u4wos_12b X86 fresh install + fully patched (last ones applied today) with smpatch update and pca. started up patchsvr and set smpatch to use it; now smpatch analyze can see missing patches (123898-03 and 123897-03), but smpatch