2 Replies Latest reply on May 20, 2009 2:35 PM by Roy Marshall

    [JS][CS3] Copy-Paste

    Roy Marshall Level 1

      Hi

      I am pretty sure this has been asked before, but I cannot find it in the forum.

      Is there a way to include in the JS a copy method to select an image, and paste into a text frame as an inline graphic?  I have placed images as inline graphics before with JS, but I was using a path to a folder.  In this new case, I cannot point to a folder for the image as the image is not on an attached volume, I am carrying out this script on a document already populated, but with missing links.

       

      I hope this makes sense to someone!

       

      Cheers

       

      Roy

        • 1. Re: [JS][CS3] Copy-Paste
          Dave Saunders Level 4

          Hi Roy,

           

          It can indeed be done that way. You just have to select the insertion point (and I mean select in this case) before issuing the paste.

           

          I prefer to use a library to achieve this goal, along these lines (this code assumes I already have a library open):

           

                var myTableTab = myDoc.textFrames.item("TableTab").getElements()[0];
                // Move TableTab inline using library for temp storage
                var temp = projLibrary.store(myTableTab);
                temp.placeAsset(myStory.paragraphs[tableLoc].insertionPoints[0]);
                temp.remove();
                myTableTab.remove();

           

          An advantage of this approach is that it leaves the clipboard unchanged.

           

          Dave

          • 2. Re: [JS][CS3] Copy-Paste
            Roy Marshall Level 1

            Hi Dave.

             

            The library method makes sense, I will give it a go when I get a mo.

             

            Cheers again,

             

            Roy