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

Similar Messages

  • CS4 text wrap over anchored object

    Every time I place an anchored object (doesn't matter if it's graphic or text frame) and apply text wrap, Indesign freezes permanently and only solution is killing it via task manager.
    I opened CS3 file with anchored objects w/ txt wrap and the same freeze happens when trying to move, delete or apply different wrap settings to object.
    It never happened in previous version of ID on my machine.
    Any solution to this problem? Thanks.
    My PC conf.:
    AMD x2 2.7
    2GB RAM
    Vista 32bit

    The first thing to try is replacing your preferences.
    http://livedocs.adobe.com/en_US/InDesign/5.0/help.html?content=WSa285fff53dea4f86173837510 01ea8cb3f-6d1e.html

  • Is it possible to have an anchored object linked to a paragraph style?

    I want to link an anchored object to a paragraph style, so that whenever a paragraph that has a particular style is created, an anchored object is created at the same time. The particular application is to label the associate text with the anchored object. is this possible?

    Here an example for a GREP search/replace:
    Search for the beginning of every paragraph + the first character:
    ^(.)
    Replace with the formatted contents of the clipboard + the found character:
    ~C$1
    Uwe

  • Release all anchored objects at once

    Dear All, I want to release an all anchored objects from my file. All anchors are created inside the table. I am using InDesign CS4.
    I have a file for 4 pages which is containing more than 150 images to be released from anchored. That images should be placed in the same place. Only need to release. I want to do this for more than 100 files (400 pgs. it may increase in future). I tried this in Search/replace option using Object, but only i can able to find using custom option in the anchor options panel, not able to relase using search and replace.
    Please help me ASAP.
    Thanks in Advance, Thiru

    Hi Path,
    Your wrongly entered the code myDoc.ChangeText() instead of myDoc.changeText();
    Please copy my previous code and run once again i think you typed wrongly.
    Please copy and paste estk and run the script.
    var myDoc =app.activeDocument;
    app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
    app.findTextPreferences.findWhat= "^a";
    myDoc.changeText();
    app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
    mr.pathi wrote:
    Hi CSM,
    Thanks for your help. I copied this code and i run this script but while running this I am getting an error like below:
    JavaScript Error!
    Error Number: 1
    Error String: changeText
    File: C\...
    Line 4
    Source: myDoc.ChangeText();
    Could you plz check and let me know. Thanks in advance.
    thx
    csm_phil

  • 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.

  • Copy paste anchored objects in a table

    Hi all!
    I must design very often posters with a lot of brands logos  (events sponsors) distribuited like anchored objects in the cells of a table.
    Very frecuently, the list of brands changes after designed the poster, adding or deleting someones, and then i must replace the logos one by one.
    I'm programming a script that moves the content of the cells, making space to the new inserts, or filling the space leaved by brands out. I use the "content" property of the object "cell", and it really works with text (its useful for me in others cases, anyway) but it makes absolutly nothing with the anchored objects.
    Somebody have any idea that can help me?
    Thanks for your help, and sorry for my english!
    Jose

    Oh, and what is very helpful:
    The parent of an anchored object is a Character Object.
    Example 1:
    A text frame with an anchored object (the magenta square).
    The text frame is selected.
    If you ask for the count of characters in the text frame:
    app.selection[0].characters.length;
    The answer is "5"!
    The anchor, that is indeed the anchored rectangle, is treated as a character.
    If you select the anchored object and ask for its parent:
    app.selection[0].parent;
    The answer is "[object Character]".
    To move such an anchored object without loosing its anchordness, you have to move the character.
    In the above case, the character is characters[0] of the text frame. Or more precise, the characters[0] of texts[0] (all formatted text in the text frame) of the text frame. You also could go a step backward and say: in this case it's the characters[0] of texts[0] of the parentStory of the text frame
    To move it somewhere else (e.g. to a cell of a table), you must move it to another Text object.
    Every insertion point is a text object (like every character).
    Example 2:
    A table comes into play:
    The text frame is still selected.
    And the following code will move the anchored object (indeed the character) to the table:
    var myTextFrame = app.selection[0];
    var myTable = myTextFrame.parentStory.tables[0];
    myTextFrame.characters[0].move(LocationOptions.AFTER, myTable.cells[0].insertionPoints[0]);
    Situation after executing the snippet:
    Hope that helps,
    Uwe

  • 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

  • Anchoring Object to a Paragraph Style? Objects behind text

    Hello,
    I am trying to anchor an graphic object to a paragraph style that is a numbered paragraph.  I have set up my numbering and I want a single graphic to be anchored to the number so it appears behind the number each time I choose that paragrah style.
    Is this possible to do?
    Or perhaps I should ask how other people put graphics behind bullets or numbers and have them anchor to the text...
    I sure could use soem help with this; it seems like it should be easy...
    Dave.

    I found this intriguing, so I thought I'd see what I could come up with.
    I made a numbered paragraph style, to start. Then I made a Cyan filled ellipse, which I anchored in front of the first word in one of the paragraphs, and changed the positioning to custom and made sure it was relative to the anchor, and turned off keep within frame boundaries, to allow me to position it "behind" the number. As emmanuel points out, anchored objects are actually in front of the text, so so far it's not working.
    I selected the ellipse and changed it's blend mode to multiply. This will not change it's color where it is over white, but it will darken wherever it is on top of another color, creating a rich black number, for example, if you used black text. Looks pretty good now.
    Select the ellipse and create a new object style based on it. This will by default include the blend mode and anchored object parameters, and be sure the style is applied to the selected ellipse. Now cut the ellipse and paste it on the pastboard out of the way so you don't lose it.
    As long as the object is on the clipboard you can use it for a find/change operation, so you can do that now, or later, just by copying it again when it's convenient. The find/change needs to be a GREP search for ^(.) which means find any character at the beginning of a paragraph, and replace with ~c$1 which means replace with the formatted contents of the clipboard and the found character. Be sure to set the find formatting options to the numbered paragraph style.
    Because you gave the object an object style that includes the blend mode and positioning, and you pasted it as a formatted object, those attributes are preserved and the graphic will be positioned correctly for each paragraph.
    Peter

  • 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

  • [CS3] GREP-Problem with Anchored Objects

    Hi,
    I've the following problem:
    Lines beginning with a, b, c etc. should be formatted equally, so I use the following GREP:
    Search:
    ^([a-z])(\.??)([ \t])
    Replace:
    $1.\t
    Now there are some abc lines, which begin with an anchored object, so I tried:
    Search:
    ^(~a*?[a-z])(\.??)([ \t])
    Replace:
    $1.\t
    But with this, the anchored object is deleted. Is this a bug or am I doing something wrong?
    Thanks
    Tobias

    That's a known bug -- Dave Saunders discovered it, to his surprise, I might add. There seems to be no reason for it.

  • Placing anchor objects

    Hi guys,
    I am just testing a script for a project, while executing, the following error occurs. Attached my snaps here for your reference.
    Target is: The document has the word "[H1]", this words needs to apply pstyle and replace with an anchor object. I had created the library assets too. I think I'm almost at the end. The execution is done for the first instance correctly, after that the error occurs as telling "Text cannot be moved to its current location"
    Here is my script:
    var mydoc=app.documents.item(0);
    app.findTextPreferences=null;
    app.changeTextPreferences=null;
    app.findTextPreferences.findWhat="[H1]";
    app.changeTextPreferences.appliedParagraphStyle="H1"
    app.changeText();
    var myfounds=mydoc.findText();
    var myLib=app.libraries.item(0);
    var myAssets=myLib.assets.item("H1");
    for (i=0;i<myfounds.length;i++) {
        myfound=myfounds[i];
        myAnchObj=myAssets.placeAsset(myfound.insertionPoints[0])[0];
        myfound.move(LocationOptions.after,myAnchObj.insertionPoints[0])
        //myAnchObj.appliedObjectStyle.name=="OBJ"
    Hope you guys will clarify me. Thanks in advance.

    Hi Kahrel,
    The script is doing pretty good. And I have a still doubt on this.
    Can you please give more clarity for this "the references to the remainder of the found items in the array have shifted", means, actually where it is shifted?
    Thanks much!

  • How to remove an anchored object from paragraph

    Hi All,
    I have a paragraph which have inline anchored object.
    Is it possible to skip anchored object from the paragraph tagging it.?
    Need Some method using which I can remove the anchored object from paragraph.
    Regards,
    Alam

    Hi,
    To skip and to remove can differ, so you have to decide what is a goal.
    Removing this can as easy as calling find...replace method (app.findTextPreferences.findWhat = "^a")
    Jarek

  • 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.

  • Get textFrame by label returns null and anchored objects

    I have the following two functions:
    function getByLabel(page, label)
        for(var i=0; i < page.allPageItems.length; i++)
            if( page.allPageItems[i].label == label )
                return page.allPageItems[i];
    and
    Object.prototype.findItems = function(/*obj*/props)
        if( !('everyItem' in this) )
            throw new Error("Error: " + this + " is not a collection.");
        var ret = this.everyItem().getElements(),
            i = ret.length,
            e, p;
        while( i-- && e=ret[i] )
            for( p in props )
                if( (p in e) && e[p]===props[p] ) continue;
                ret.splice(i,1);
        return ret;
    In my page structure, I got one main text frame (the content area) and two vertical text fromes on the sides of the page. There is also a small box textframe on top of the page. All these textboxes EXCEPT the main text frame are ALL "ANCHORED objects". I had to make them anchored objects, eitherwise after importing data, the boxes would jump around. (Example, the small box textframe that is on the top would get moved to the content area textframe etc). Not sure if using anchored objects is the proper way to fix this.
    When I try to get the small box text frame, it does not work using the findItems (returns null) but it works fine with the getByLabel method. Why is that?
    The calling syntax is:
    for( i=0 ; i < doc.pages.length ; ++i )
            var page = doc.pages.item(i);
            var textFrame = getByLabel(page, 'lblSection' ); //This works
            //   var textFrame = page.textFrames.findItems({ label:  'lblSection' })[0]; This does not work, returns null
            if( textFrame != null )
                textFrame.parentStory.contents = "";

    (function () {
        // Per the InDesign Scripting Guide, app.activeScript is only
        // valid when a script is directly executed from InDesign, not
        // from the ESTK, so a try/catch block is recommended to handle
        // it.
        var d;
        try {
            d = app.activeScript.parent.parent.fsName;
        } catch (e) {
            d = Folder.appPackage.parent.fsName+"/Scripts";
            return d;

  • Text wrap in anchored objects

    In order to place text boxes relative to the spine, I have placed them as anchored objects.
    But now, these text frames do not respect text wrap setting from objects outside of the anchored object.
    I have made sure that ignore text wrap in text frame options is not checked.
    Is this a bug?
    And does anyone know a workaround?

    In order to make my design indifferent to later added pages, I have placed all text frames and graphic placeholders as anchored objects, positioning them relative to spine.
    When I now place an object on top of such an anchored text frame, text wrap is not working, even if i overide the master page item.
    The only work around I have found is to copy the respective text frame and make the original master page item unvisible.
    Is there not another way to to this?
    For me, the best would be another way of placing text and graphic frames relative to spine.
    Bus as soon as one overrides the master page item, the object is not placed anymore relative to spine if another page is inserted.

Maybe you are looking for

  • IOS code signing fails only on AIR 3.4+

    I am building a Flex application for iPad (iOS 6.1.3) using Flash Builder 4.7 on OSX Lion. I can successfully build my IPA using Flex SDK 4.6.0 with AIR 3.3 overlayed. However if I do the following: 1. change the Flex SDK to 4.6.0 with AIR 3.6 overla

  • Gnome crash after pacman update [solved]

    hey, i update my system and restart the computer. Display Manager is boot up (Slim), i log in and i get crash. "oh no .....all extensions have been disable...." I thought it might be something with that extensions so i removed them (~/local/share/gno

  • Final cut pro make Mac pro kernel panic with RAM from other manufacturers

    hi all if i installed RAM For mac Pro from 667MHz DDR2 fully buffered ECC RAM from other manufacturers final cut pro (just final cut) make the machine kernel panic messege all programs working good (like adobe and other compositing program) but final

  • I am trying to download the Adobe Photoshop CS6 Extended Student and Teacher Trial

    I am trying to download the Adobe Photoshop CS6 Extended Student and Teacher Trial and it had me download te assistant. After downloading the assistant, I installed it and I signed in. It wants me to pick a product to download and the Adobe Photoshop

  • PDF/X1a with a logo containing a colorized grayscale tiff not printing properly

    I have a 3 color logo: black, PMS 200U, and PMS 1955U. The logo was built in Illustrator and I have placed grayscale tiff ontop of it. The grayscale tiff is a stipple (dots) effect that I colorized to PMS 1955U in Illustrator, masked it out on top of