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

Similar Messages

  • Copy/Paste cells in the same table

    How can I copy/paste rows inside the same table?
    I tried with ITableModel, but its function CanPaste() returns me kFalse. And I tried with kTableCopyPasteCmdBoss/ITableCopyPasteCmdData, it crashed.
    Thank you in advance,
    David

    You are correct, but this behavior has always amazed me. ID *never* inserts the correct amount of copied rows inbetween others -- rather, you have to count how much you are going to copy, then insert blanks, then paste, then double-check you didn't accidentally overwrite existing ones!
    If you are writing a general plugin to handle tables, you might think about doing this automatically. I don't know, perhaps you can test how much rows are "in the copy buffer" at the time of pasting.

  • How can i copy,paste an Object ?

    How can i copy,paste an Object which i define by myself?

    implements Cloneable and define a clone method, for example
    public class ObjectA  implements Cloneable {
       // Data member
       String data;
       public ObjectA() {
       public void setData(String data) {
          this.data = data;
       public Object clone() {
           ObjectA tempObject = new ObjectA();
           tempObject.setData(this.data);
           return tempObject;
    }

  • Copy & paste embeded object to file system

    Cross-post at:
    http://stackoverflow.com/questions/27685791/copy-paste-embeded-object-to-file-system
    Background:
    I wrote a large piece of VBA code in an Excel workbook to help handle a lot of repeating jobs. I found it is painful to maintain and modify the code by using the "pool" VBA Editor. Then, I decided to move those VBA code to C# solutions, which I
    suppose I can benefit from the modern editor - Visual Studio.
    Problem:
    Although I don't know too much about VBA, I know even less about C#. Hence I got some problem when I try to "translate" my VBA code to C#, and here is one of them:
    I create a document-level solution for Excel. I need to embed some files (.cab, .exe) into the solution, so when I run a method (e.g. by clicking a button), those files will be copied to the file system, and do some job.
    In VBA, I embedded those files in the Excel workbook, then I can copy the embedded objects to the clipboard by using the following VBA code:
    Sheet1.OLEObjects("obj_cab").COpy
    And then I can paste the object to the file system by using the following VBA code:
    CreateObject("Shell.Application").Namespace("C:\Sample\").Self.InvokeVerb "Paste"
    In the C# solution, I can use the following equivalent method to copy the embedded object to the clipboard:
    Microsoft.Office.Interop.Excel.OLEObject OLEobj = (Microsoft.Office.Interop.Excel.OLEObject)sheet1.OLEObjects("obj_cab");
    OLEobj.Copy();
    Then I stuck here, I don't know how to get this object from clipboard and put it to the file system. The 'CreateObject' method does not exist in C#.
    Anyone can help? Either a better way to embed those files or a working way to paste those objects (files) from clipboard to the file system?
    Thanks a lot!

    Hi FantaC,
    It's possible to save the oleobject to the disk. But it's not very simple. Because when you call the Copy method of OLEObject to clipboard, it's actually not the exact the oleobject file itself, it's actually a wrapper of the file, it means that it has different
    file headers and some other information from the original oleobject file.
    To save oleobject on the disk, you need to analyze the byte array by yourself, this would be a little complicated. You could check the answer in this thread for the code sample:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/1ab7a178-8021-4c67-a14b-5031a254fd9c/saving-oleobject-content-to-a-file
    The original poster of this thread also write a blogpost about this, you can check it here:
    Saving OLEObject Content To File
    Detailed information and code samples are provided in this blogpost.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to copy/paste anchor text box to its anchor point in text and delete all empty anchors?

    hi all
    i have a document of few pages but one story. The right column is the main text box and on many places anchored text boxes are placed which appeared on the left column as shown below.
    i want text of each anchor-text-box to be cut from its place and paste at its insertion/anchor point and delete all empty anchored boxes.
    I am trying since morning but i unable to reach anchor object reference. Any help on how to start with will be helpful.
    virender

    Ok, let's say you have one main text box (not anchored) and three text boxes that are anchored to text within it. The first one is anchored with text, the second one is unanchored, and the third one is empty (I'm not going to get into inline anchoring vs. custom anchoring since you didn't bring it up in your post).
    We cycle 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 might be that you're not looking at the main text frame and then checking to see if anything is anchored to it. You're looking at each text frame and figuring out if it is anchored. That's my approach, anyway.

  • [CS4-CS5] Importing anchored objects into a table

    Hi,
    do you know if is it possible to import a table in ID through an XML file positioning an image (as an anchored object) within a cell?
    I'm currently importing a table but it looks to me like it's not possible to add images...
    I tried with this XML:
    <Container xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/">
      <Table aid:trows="10" aid:tcols="5" aid:table="table">
        <Cell aid:table="cell" aid:theader="" aid:crows="1" aid:ccols="1">...</Cell>
        <Cell aid:table="cell" aid:theader="" aid:crows="1" aid:ccols="1"><Image href="file:///Users/Me/Desktop/Image.jpg"/></Cell>
      </Table>
    </Container>
    but it doesn't work at all.
    Also, if I export XML structure after inserting an image within a cell it doesn't appear in the exported XML.
    I doubt it's possible...
    Thanks anticipately!
    Lele

    Hi,
    To import PDFs you can refer following links
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/c01f54a2-99f1-2a10-5aa5-dcc50870e7f6
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/e057a910-3d4b-2b10-b490-cb569d694614
    Regards
    Nisha

  • Copy, paste typing object

    Is there any way to copy a "typing" object and paste it
    somewhere else? I'm trying to edit a project and one of my slides
    contains a typing object of a key being pressed. This object
    appears in the timeline but there does not seem to be any way to
    copy it and add it to a different slide. Any advice on how to do
    that?

    Hi gobaldsoon (I'm bald all the time!)
    Unfortunately there is simply no way to edit the typing
    object. Because of this, I find them way too limiting and never use
    them. What you
    can do, however, is to download fellow Adobe Community
    Expert Paul Dewhurst's Typing Text animation from the Captivate
    Exchange. You may visit the Captivate Exchange by
    Clicking
    Here
    Cheers... Rick

  • Copy-paste of a chart or table in new iWork creates a low resolution raster rather than a vector

    In iWork '09 I regularly copied charts, tables, etc. from iWork applications to other applications. They were in vector format. For instance, I have made a chart in Numbers, copied it, and pasted in Preview. This resulted in a vector which I saved to PDF, everything in less than 5 seconds.
    It seems that in the new iWork this is not possible anymore, because the result is a low-resolution raster, which totally broke my workflows.
    Is this an "enhacement" of the new iWork or I am missing something?

    Hi Badunit,
    A possible explanation for our discrepency:
    If I copy an entire page from a vector pdf using the thumnails bar in preview and paste that page into keynote, the image is a raster.
    If I select a portion of that page with the preview selection tool, copy, and paste into keynote, the image is a vector.
    This issue is especially damaging because I can't drag and drop pdf files I create into keynote. Major bugs have been introduced with regards to vector images, and I'm unable to identify a single rule characterizing this process. This is a disaster as I've relied on keynote as a longterm storage and organization tool for many vector images. Many of these images have now been corrupted in what I assume is an irreversible process.

  • Numbers: Copy/Paste from multiple tables into 1 single Table?

    I would appreciate some guidance in creating a copy/paste script from multiple numbers tables into a different single table within the same numbers document.
    The columns in the source table are in different positions to the destination table.
    So for example, i would want to copy…
    Sheet 1, Table 1 Cell A3  copy to Sheet 2 Table Z Cell B2
    Sheet 1, Table 1 Cell B3  copy to Sheet 2 Table Z Cell C2
    Sheet 1, Table 1 Cell C3  copy to Sheet 2 Table Z Cell E2
    Sheet 1, Table 1 Cell D3  copy to Sheet 2 Table Z Cell F2
    Sheet 1, Table 1 Cell E3  copy to Sheet 2 Table Z Cell G2
    Sheet 1, Table 1 Cell G3  copy to Sheet 2 Table Z Cell I2
    Sheet 1, Table 1 Cell J3  copy to Sheet 2 Table Z Cell H2
    and repeat the copy/paste on subsequent rows of each table until there is an empty row in Sheet 1 Table 1 (or if this is difficult, say set the repeat to a max of 30 rows).
    The script would then need to move on to Sheet 1 Table 2, and do the same copying to Sheet 2 Table Z (from where the previous copy/paste finished in Table Z).
    Repeat process would finalise with Sheet 1 Table 6.
    The Paste part would need to be pasting values, as the cells in the source tables do contain some formulas.
    At the moment this is all done manually and does take some to to undertake.
    If anyone can help, i would be very grateful.
    Thanks,
    Colin

    Interceptor,
    are you trying to aggregate data from severl tables into a single table?  If so you whould be able to do this without a script.  The function indirect() will allow you to construct the proper formula, which you may fill over (in the same row) to the appropriate cells, then fill down.
    Here is a small example:
    There are three data tables ("Table 1", "Table 2", and "Table 3").  And a summary "Table Z"
    In table Z make the first row a header (as shown):
    Use column A to enter the Sheet name and colomn B to enter the table name.
    In row 1 (the header), enter the cells you want to get
    in cell C2 type (or copy and paste from here) the formula:
    =INDIRECT($A2&"::"&$B2&"::"&C$1)
    now select cell C2, copy now select cell C2 thru H2, paste
    now select the cells C2 thu H2, hover the corsor over the bottom edge of the selection, and drag the yellow cirlc down as needed to fill the formula down.
    Update the sheet and table names as needed for each row

  • Is there anyway to get anchored objects to always be above line?

    When I copy an object (lets say an image) in InDesign with the Move Tool (V) selected and then paste into text it sometimes it's above line and sometimes it's inline. Text wrap doesn't seem to make any difference.
    When I copy an anchored object that is nicely above line and text is flowing around it and then paste it somewhere else in the text it changes to inline. How can I get these always to be above line instead of having to change them all?

    Change one of them to be Above Line (preferably the first time you anchor it)
    With the object anchored and in the position you want - go to Object Styles and create an object style for your anchored image and apply it.
    Now copy and paste the object to another location within the text.

  • Copy/Paste/Clipboard Problem; Pastes only as SVG Code

    I have Illustrator CC installed, as well as Illustrator CS6, running Windows 7 x64, latest patchlevel. When I try to copy and paste objects in Illustrator CC, I always get a SVG code. I draw a simple rectangular, copy it, paste it, it's not pasted as a rectangular, it's pasted as SVG code. Same with an embedded JPEG. Copy it. paste it. et voila, SVG code...
    In Illustrator CS6 everything works as i would expect it. Highlight object, cmd+c, cmd+v, ok.
    In CC, highlight object, cmd+c, cmd+v => svg code [<!-- Generator: Adobe Illustrator 17.0.0, SVG Export Plug-In  --> etc. pp.] This always happens, no matter where (copy in illustrator cc, paste in the same illustrator document, word, photoshop, etc) or what (drawn object, jpeg, embedded, linked, gif).. I've tried different clipboard settings in Illustrator CC, it makes no difference.
    HELP!

    Of cause it is, but still I think it's a bug.
    I don't think it should work this way. First, Include SVG Code to me is not equal to Replace copied objects by SVG Code. When I copy an object from an Illustrator file and then try to paste it back into an Illustrator file, why should I get code instead? Second, that code was not pasted every time. Just about every second or third time. Sometimes it worked with a single object, sometimes to get that SVG code I had to copy/paste multiple objects, while pasting single objects worked as expected. So, to me it looks like a bug.
    And anyway, even if this function is supposed to replace objects with code, it should not be ON by default, not all of Illustrator users are developers. My estimate, most of us are not, actually.

  • Vector COPY/PASTE..wmf..svg..emf etc

    Hello:)
    Im looking for a component to integrate in an application to copy/paste or import/export vectors between programs.
    If theres someone that can assist me, will be great.
    Is it possible that someone has the file structure /source code for emf/wmf ??
    Thanks for any consideration
    [email protected]
    Please email directis you can really assist me.

    Of cause it is, but still I think it's a bug.
    I don't think it should work this way. First, Include SVG Code to me is not equal to Replace copied objects by SVG Code. When I copy an object from an Illustrator file and then try to paste it back into an Illustrator file, why should I get code instead? Second, that code was not pasted every time. Just about every second or third time. Sometimes it worked with a single object, sometimes to get that SVG code I had to copy/paste multiple objects, while pasting single objects worked as expected. So, to me it looks like a bug.
    And anyway, even if this function is supposed to replace objects with code, it should not be ON by default, not all of Illustrator users are developers. My estimate, most of us are not, actually.

  • Copy-paste trouble

    I can copy and paste slides and other objects in CP, but my teammmate cannot. I use CP 7.0.0.118. He uses CP 6.0.1.240. Why can he not copy and paste? How can we restore this functionality for him? I have not discovered any relevant control in the CP Preferences.

    Is he by any chance copy-pasting slides/ objects from Captivate 7 to Captivate 6? In that case, it will not work. Sadly, you won't get any error message. Even vice-versa won't work. But you will get an error message that copied content is from earlier version of Captivate. IMO, both are features and not bugs.
    I was able to copy-paste slides/ objects between projects created in Captivate 6.0.1.240.
    Sreekanth

  • Copy/paste opacity problem

    I´m having this weir issue with objects that have gradients with opacity.
    If I drag to copy, it´s makes a perfect copy. But if I copy/paste the object it becomes solid. This applys copy/paste in the same document and if I try to copy/paste into a new document.
    This problem came with the upgrade to Illustrator CS6.
    Anyone?
    Mac OSX 10.7.5
    Adobe Illustrator 16.0.4

    Does not happen to me
    MAC 10.8.4
    AI 16.04
    I have 2 gradient stops of white, (Opacity 100%, Opacity 0%), are yours the same?
    Check your clipboard settings.

  • An idea for copy paste.....

    When I used to use iWeb, I could copy paste and object from one page and paste to another (this works in muse) but the problem in muse is that the object does not drop to the EXACT location that it was pasted from on the other page. This can make it frustrating when you want to have every thing line up exactly...I find myself wasting alot of time.
    Please consider having the Copy (from) paste (to) drop the item in the EXACT location it came from on the different page. That would be sweet!
    Thanks so much!

    Hellp Mark,
    I would suggest you to please log it as a feature request under our "Ideas for features in Adobe Muse" section of the forums (http://forums.adobe.com/community/muse/ideas).
    It is a good feature request I would say.
    Regards,
    Sachin

Maybe you are looking for

  • Yoga 13 doesn't have an option to create recovery media in onekey recovery

    Hi All, I am prepping a new Lenovo Yoga 13 for a user.  I want to create recovery DVD(s) for the new system with the OneKey Recovery software.  When I open the application there is no option to create media.  There are only a backup option and a rest

  • JtextField Flickering

    Hi All I am facing a flickering problem in applet which is having a Swing component.I am using SwingWorker class from sun to do some background processing in event thread i tried SwingUtilities.invokeLater did help me but not that much GUI used to ge

  • Opening Blanace for PLA Account

    Dera All, When I enter the Opening balance how do I enter the opening balance of PLA Account. Generally when the payment to PLA is made there is a discretion that the PLA is being paid against which components (like BED, Cess & HCess). But when I put

  • Why does every attempt at installing CC Desktop App (update) fail?

    I have been with Adobe Creative Cloud for a few months but lately when CC says an update for the desktop app is ready for download it will nearly finish installing but always end in this dialog:  "We've encountered the following issues:  Creative Clo

  • Help on showing currency symbol for '?'

    SQL>select * from nls_database_parameters; PARAMETER VALUE NLS_NCHAR_CHARACTERSET UTF8 NLS_LANGUAGE AMERICAN NLS_TERRITORY AMERICA NLS_CURRENCY $ NLS_ISO_CURRENCY AMERICA NLS_NUMERIC_CHARACTERS ., NLS_CHARACTERSET UTF8 NLS_CALENDAR GREGORIAN NLS_DATE