How to copy/paste the text box anchor to its anchor text and remove all checkpoints empty?

Hi all

I have a document of a few pages, but a story. The right column is the area of main text and on many places, anchored text boxes are placed which appears on the left column, as shown below.

I want the text of each text box anchor to cut of his place and sticking to its point of insertion/anchor and remove all of the empty boxes of anchored.

I'm trying since this morning but I was able to get the anchor object reference. Any help on how to start with will be useful.

Marie rosine

anchor_box.png

OK, let's say you have a main text (not rooted) box and three text boxes that are anchored to the text it contains. One is anchored with text, the second is not anchored and the third argument is empty (I won't get into the anchor vs custom anchor line given that you mention in your message).

Scroll us through the items on the page:

function main(){
  var myDoc = app.activeDocument;
  var myPages = myDoc.pages.everyItem().getElements();
  for (var i = 0; i < myPages.length; i++){
  {
    var myPage = myPages[i];
    //Checks that the page is valid, and that it is not a master page. If either is true, skips to the next page.
    if (myPage.isValid == false) continue;
    if (myPage.parent instanceof MasterSpread) continue;
    var myItems = myPage.allPageItems;
    for (var j = 0; j < myItems.length; j++){
      //Current item.
      var myItem = myItems[j];
      //If myItem doesn't have a Character parent, it is not anchored.
      //The first and third text frames would fail this test.
      if (!(myItem.parent instanceof Character)) continue;
      //We only care about text frames.
      if (!(myItem instanceof TextFrame)) continue;
      //I think the only way this would happen would be if you had an image or
      //something else unexpected within the frame. I check for it so no content
      //is inadvertently lost.
      else if (myItem.texts.length > 1) continue;
      //If we're still in this iteration of the loop, all qualifications are met.
      //Flatten the text frame.
      //I don't use layers that often so, to me, flatten makes sense. You may want
      //to use a different term if there's a chance for confusion.
      flattenItem(myItem);
     }
   }
}

function flattenItem(funcItem)
{
     //Hold onto the anchor character.
    var myParent = funcItem.parent;
     //Duplicate the text from within the frame so that it appears right after the anchor.
     //There may be other methods, but this works for me. I try to avoid copy/paste
     //so as not to deal with any clipboard mishaps. I added a check in case of empties.
     if (funcItem.texts.length > 0){funcItem.texts[0].duplicate(LocationOptions.AFTER, myParent.insertionPoints[0]);}
     //Replace the anchor character itself with a space (or whatever) which also
     //deletes the text frame it was anchoring.
    myParent.contents = " ";
}

I guess the takeaway is perhaps you aren't looking at the main text block and then check if anything it is anchored. You are watching each text block and find out if it is anchored. That's my approach, anyway.

Tags: InDesign

Similar Questions

  • The menu copy paste the text in email on my iPad disappears before I can click on it

    I am able to select text in an email, but the options menu to copy the text and paste it disappears before I can use it. How can I stop it endangered?

    Try a simple Reset: hold down the Home and Power buttons until you see the Apple logo (10 to 20 seconds).

  • How a copy paste a text layer of the file one psd to another?

    Hello

    CS6

    I select the type tool, type some text, create a text layer.

    I went with this still active text layer, ctrl a, selection puts on the perimeter of the entire image, ctrl c (copy) and clicked on the psd file tab I wanted to put it in and went ctrl v (paste)

    text appeared.

    HOWEVER... This isn't text, try selecting the it, you can't!

    To the search, in the layers palette, it is not not a text layer as it was in the psd source.

    going on what?

    I copy paste on this occasion, not drag drop.

    Merlin

    Instead of copying the pixels (what does your process) instead do a right-click on the text layer - select «Duplicate layer...» "and where it says - Destination - click on the dropdown next to"Document"and the change to the file that you are trying to move the text to.

  • How to copy / paste the Image

    I received a PDF file with an image only - no text.  I would like to copy / paste this image twice so that I find myself with three of the same image on the page.  Adobe TV makes it look so easy, but I noticed that there is an area of text around the image. The image I have is not in a box.  I can put a box around it somehow, or is there another way to copy and paste? Help, please!

    By copying and pasting an existing image in the same PDF are not really simple in Acrobat X. First, select the image with the selection tool, then right click and select copy the Image. Next, you'll need navigate to the comment pane and click the stamp tool. and select Paste the image to the Clipboard as stamp tool.

  • N-copy-paste the text in the dialog

    Hello

    By topic titles, we have a javascript that worked in InDesign CS4 with enable n-copy-paste, we have noticed recently, n-copy-paste no longer works in CS5 - CS6 when the windows prompt appears. The script itself still works well, but without the ability to copy - paste text, it slows down us a little. We noticed if the copy and paste is done via the Edit menu then the prompt window will accept the pasting and continues to ignore anything else copied from office and elsewhere. Adobe has broken something with CS5 or more? Anyone has similar problem or has a solution? It's one thing to setting preferably need changed?

    Thank you!

    Yeh, a right-click with a mouse works; simply not CMD - V on the keyboard (mac).

    I can copy 'text' of anywhere outside InDesign and it works too.

    Thank you Trevor.

  • How can we change the text and fonts when you use the feature "painting".

    I use the "feature of the paint to the text of the announcement for the pictures, but I can't understand how to change the size of the text or characters.» The 'help' in the painting says that you can do both, but they don't say HOW! Help?

    Hi PTWG,.

    If your using Vista or XP while in the painting after that you drag the text window will come the possibility to change the font and size. If you do not see this option click on view and be sure there is a check box in the text toolbar.

    Does this solve your problem?

  • How can I copy/paste the text in my PDF?

    I can't create PDF of security that allow NOT to copy text. It seems I follow the steps of safety yet am still able to copy and paste.

    After you apply the security save, close and reopen the document.

  • I copied a picture into Microsoft word how to copy - paste the image in Photoshop, so I can increase it to 500 pixcels?

    inactiveforumnotifier Amy_Wong Newsgroup_User Zoheir Debbie

    Select the Image in Word > right click and select Save as picture. Once saved, open the image in Photoshop.

    ~ David

  • How can I change the texts and images now that I bought Adobe PDF Pack, annual?

    Hi I just bought the annual Adobe package, thinking that I can edit existing pdf documents, but it does not allow to perform this funtion?

    Please can you help.

    TKS

    Hi bluehorizonevents

    To edit documents, you can use Adobe Acrobat.

    Please visit: http://www.adobe.com/in/products/acrobat/pdf-editor-pdf-files.html

    You can download the free trial version and use it for 30 days...

    Another way to do it is:

    1. Firstly convert your PDf document to Word/Excel using ExportPDf Service.

    2 changes in the document using MS Word or another application.

    3 convert it back to PDF using CreatePDF Service,

  • Paste the text copied without formatting in the form fillable

    I created a PDF form to be completed online for my clients who copy and paste a large amount of information to ensure accuracy. There are several fields that are marked as multiline and formatting so that the field adapts most of the information, however, when customers are copy and paste the information that they are facing two problems:

    1. He is coming with the source rather than the defined field of formatting formatting
    2. When they try to paste several lines of text, it is not wrapped in the field as it should. Instead, he says that he can not paste the text and runs to the end of the field, even if there is a lot of room below.

    This form was created using acrobat and fill using reader. Are there solutions to these two problems?

    Under the Options tab of the field properties window, is the 'allow Rich Text Formatting' selected? If so, that probably the reason and it must behave as you want, when it is turned off. If yo don't want the user to be able to enter more text than the field can display, you should also deselect the option "text long scroll.

  • Can not copy paste the opacity animation

    All-

    I can't copy paste opacity animations on board inside the symbol.

    I can copy paste other animations like XY while in the symbol, but not opacity

    Work is about to repeat the animation to the point if necessary

    Am I missing something?

    Hello

    takehigoproject wrote:

    Please tell us how to copy paste the animations of symbol for the different timeline or another symbol?

    Edit > Paste Special > paste it all.

    HTH,

    Joe

  • How to re - activate the functions 'Restore previous Session', "Recently closed tabs" and "Recently closed Windows" in the menu of history?

    For some time, four choices in the restore section (tabs of other devices, Previous Session Restore recently closed tabs and recently closed Windows) have been shaded. Keyboard shortcuts do not work, and didn't undo closed tab in the context menu of the tab.

    I found and tried various patches to do this, including:

    • From Firefox in Mode safe without addons.
    • Firefox reset.
    • Change the values of browser.sessionstore.max_tabs_undo and browser.sessionstore.max_windows_undo in all: config.
    • Check to see if I have a user.js in profile Firefox. (I don't).
    • Verify that the private browsing is not the default mode. (It is not).
    • Create a profile to see if it had the same problem. (He did.)
    • Running anti-malware analysis. (BitDefender and SpyBot).
    • Temporarily disable my anti-virus and anti-malware.

    Any of these solve my problems.

    Other devices tab is grayed out, but I've never used, and it might have previously grayed out.

    The story works in general. Sites I visit are added to the log.

    Preferences are saved correctly when I change them.

    Any advice on how to solve the problem would be much appreciated, as I am very fond of these features and often served until they stopped working.

    ADDITIVE

    After that looking through the list of preferences of change created by the resolution of the problems, I tried now also reset the following text:

    • browser.places.smartBookmarksVersion
    • browser.newtabpage.storageVersion
    • Browser.cache.Disk.Capacity
    • Browser.cache.Disk.smart_size.first_run
    • Browser.cache.Disk.smart_size.use_old_max
    • Browser.cache.Disk.smart_size_cached_value

    The problem persists.

    I finally managed to understand this. In searching the Web, I found a thread detailing a similar problem on the Mozillazine forum. The problem has been identified as a missing browser.sessionstore.enabled set, so I went looking in Subject: config and couldn't find it. After creating the entry, by assigning the value true and restart Firefox, the functions of recovery/recently started working again. Apparently, some bookmark plugins and session-based can cause this problem, but in my case, it must have been something else, that I never had no such plug-ins installed.

    If you have this problem, here's a detailed itinerary of the way I fixed it. Whereas there seems to be several problems that can cause restore/recently functions to stop working, it is not a guaranteed fix, but it is still a thing to try, at least.

    1. Open a new tab or window.
    2. Type of topic: config address in the box and press ENTER.
    3. Read reviews and promise to be careful.
    4. Copy this: browser.sessionstore.enabled - and paste in Subject: config'search box in s. press ENTER.
    5. If you copied the text at the top right, the setting should appear in the list. If it is not the case, you have the same problem, I did. (I would say that you copy/paste the text indicated and only this text before moving on to double check).
    6. If the parameter does not exist, right click on the parameters of the list and choose new-> Boolean. Paste the parameter name that you copied previously in the name box, click OK and then set the Boolean true. Once you have click OK, restart Firefox, and (hopefully) things should work properly again.

    Thanks to everyone who offered help and thoughts!

  • Whenever I have to copy/paste the results include many points of mark boring... are not part of the original text.

    Whenever I have to copy/paste the results include many points of mark boring... are not part of the original text.  I use wordperfect 12 with Windows XP.

    How can I solve this dilemma?

    Hello, Roger Scott,.

    -Does only with WordPerfect or with other applications as well?

    If this only happens with WordPerfect so I suggest you to check with WordPerfect support for more information.

    http://www.Corel.com/Corel/pages/index.jsp?PgId=800034

  • How can I change the text independently copied element?

    Hi, if I copy a text element, and then insert it, change the inserted, also changes the original text element. How can I change the text independently copied element? Thank you! The German Adobe Web site have no idea on the copy and paste text elements

    [title published by mod]

    It's because you copy the title, which creates a clone. Change and it changes the other.

    As I show in my book, Amazon, what you really want to do is title duplicate in right-clicked on it in the components panel of project and selecting two copies.

    A duplicate makes a copy of the title, but this copy is independent and any changes that will make her to this single copy.

  • How to paste the text as default text?

    How can I get FM to paste the text as text by default, instead of having to use 'paste special '?

    (Years ago a configuration file that can be changed, but memory fails me).

    The configuration file is maker.ini... There is one master copy of the FrameMaker application, but you should rather edit your own personal copy, which will replace the captain. You can find it in:

    • "\Documents and Settings\\Application Data\Adobe\FrameMaker\" on Windows XP ".
    • "\Users\\AppData\Roaming\Adobe\FrameMaker\" on Windows Vista and later versions. ".

    FrameMaker rewrites your copy whenever it comes out - so before you change the file, quit FrameMaker, otherwise it will just overwrite your changes. Then backup the file, just in case.

    The desired setting is ClipboardFormatsPriorities. It is very unlikely to already be present, but if this is the case, modify its value. Otherwise, add this line to the [options] section:

    ClipboardFormatsPriorities = FILE, MIFW, MIF, RTF, OLE 2, META, DIB, EMF, BMP, UNICODE, TEXT TEXT

    The above is the default setting. Change the order by yourself; You can use one of the following conditions:

    • ClipboardFormatsPriorities = FILE UNICODE TEXT, TEXT, MIFW, MIF, RTF, OLE 2, META, EMF, DIB, BMP
    • ClipboardFormatsPriorities = UNICODE TEXT, TEXT FILE, MIFW, MIF, RTF, OLE 2, META, EMF, DIB, BMP

    Restart FrameMaker. No problem, go back to your backup of the file.

Maybe you are looking for