How do I get the content from another file and paste it into the active document instead of certain string?

I am newbie in indesign scripting of animals. So I apologize because I couldn't post my essays.

Objective:
I have a .indd document which will be a figure of legend, label etc. I need to copy the content (a figure that is editable) else file indd of this document where the tag figure exists.

For example:
Sample.indd

Some text Fig.1.1 caption some text 

I need to copy the contents of figure1.indd and paste in the document sample.indd where Fig.1.1 string exist and so forth. Now I do it manually. But am supposed to automate this process.

So, I need some hint how to do it using extendscript?

I found something like below, to do so, but I have no idea to develop it further and also do not know if this approach is correct my results. Please help me

myDocument=app.open(File("file.indd"),false); //opening a file to get the content without showing.

myDocument.pages.item(0).textFrames.item(0).contents="some text"; //here I could set the content but I don't knw how to get the content

// ?????? Then I have to paste the content into active document.

Try this test nicely to your and end, hope this will help you.

var myDoc = File("/D/Sample.indd");//Figure File
var myFigDoc = File("/D/Figure.indd");//Destination File
app.open(File(myFigDoc));
app.activeDocument.pageItems.everyItem().select();
myObj = app.selection;
var myGroup = app.activeWindow.activePage.groups.add(myObj);//Grouping the objects
myGroup.select();
app.copy();
app.open(File(myDoc));
app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.findWhat = "Fig 1.1";//Figure caption text
app.findGrepPreferences.appliedParagraphStyle = "FigureCaption";//Figure Caption Style
myFinds = app.activeDocument.findGrep();
for(var i=0;i 
         

Tags: InDesign

Similar Questions

  • How can I get the activation code for PC Defender?

    I have a dell netbook.  It has viruses on it.  PC Defender is constantly on it saying that if I put in the activation code sent to my e-mail address, it will remove the virus.  The code was never sent.  I can't access it from my netbook, but I can check my email from my other laptop.  How can I get the activation code so can clean my netbook?

    PC Defender is a rogue security application.  It is also a malware!  You can remove it by following these instructions:
    http://www.bleepingcomputer.com/virus-removal/remove-Windows-PC-Defender
    Trader2100

  • I would like to copy the time elapsed since WMP 11 and paste it into a Word document.

    I would like to copy the time elapsed since WMP 11 and paste it into a Word document. I have this on several occasions, is there a way to shortcut this process through Autohotkey? Would appreciate any help at all!

    Hello

    1. What is the operating system installed on your computer?

    Unfortunately, there is no shortcut key to copy the time elapsed since Windows Media Player.

    You can use your favorite search engine to search for any third party software that accomplishes your request.

    NOTE: third software of third parties, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.

  • How do I export to Dreamweaver 3 .ste file and import it into Dreamweaver CC?

    How do I export to Dreamweaver 3 .ste file and import it into Dreamweaver CC?

    In DW CS3, open the Site Manager, select the site, and then click Export. Open Manager Site CC, then import the file *. Ste where you saved in DW3.

  • How to print ONLY the active document?

    Whenever I go to file/print program PSE 9 darn all working files sends in the tray of the printer. I searched online for 2 hours, now looking for an answer.

    I enjoy working with several to several files in the 'bin' and prefer to print only the active file, I am currently working on without having to close the "working files" before I can print. How can I print ONLY the active document or file in the location of project? Please help, I upgraded from PSE 3 PES 9 and really like the updated features, but what a pain in the neck by default becomes the best of me.

    Select it in the trash before calling to the top of the print window. If nothing is selected, everything happens in the print window.

  • Copy of a flash file and paste it into another...

    I want to copy a .swf file I have and paste it into another one, executives and all.  I tried but nothing is copied on correctly.  Or are my buttons on a single image... and no longer act as a button with Up - too-Down-Hit managers.  Is this possible? Help, please...

    Thanks guys,.

    -Dedikation-

    Select all of the frame of the timeline, right-click the selection, and choose copy image.  In the other file, insert-> new symbol-> MovieClip... etc...  Select the key of one layer only the empty movieclip, then right-click the selection and choose Paste images.  All layers and managers must paste that they were copied.

  • Having a color changing the question when you copy and paste things into a new document

    Hello, I had a question about copying and pasting in photoshop (something I thought I'd be able to handle).  See the screenshots below:

    First with the move selected tool, I went to command + click on the dark blue model below to highlight and select its layer.  Then, in the following screenshot with the marquee tool, I was trying to copy a square piece of 100 x 100 px of the model.

    Screen Shot 2014-12-03 at 4.31.04 PM.png

    After hitting the command + c to copy, and then I opened a new document with the following and click settings on ok:

    Screen Shot 2014-12-03 at 4.36.11 PM.png

    I knocked and then command + v to paste what I had copied the new document that I created.  However, the part gets confused me is that the color of the background pattern that I copied and pasted is now a different color, as shown below:

    Screen Shot 2014-12-03 at 4.27.38 PM.png

    The glued color is obviously much darker than the original.  Anyone know what is happening here?  Very confused.

    Some how you have copied a composite instead of the layer + styles.

    Try this instead, select the layer as you did

    Create a new document as you did

    Use the move tool and drag the document on the tab of the new document with the mouse still down, drag your document down to the new document.

    Because your new document is set to 100 x 100 is what adapts the layer, so you should be good to go.

    If you still have a question of color or something has not transferred correctly let us know.

  • Can I copy the list of names of files and paste them into a table

    I have a list of files in a folder and here paste the titles only in a table

    You can create a list of text files by using the command prompt.

    • Open a command prompt in the folder that you want to get the list of. (You can open a command prompt and navigate to your required file, or use the Solution Explorer and press and right click on your file at the same time. Then you should see "open a command here window' in the menu - click on it.)
    • Enter the command "dir /b > filenames.txt" (without the quotes), then simply type dir /b > filenames.txtand press return/enter to transport.
    • Use Explorer to navigate to your file and you should now see a text file called filenames.txt. Open and it must contain a list of files. Then, copy and paste the list where you want to.

    If all goes well, I understood your question correctly, if so, hope it helps.




  • I changed my computer from XP to vista. How can I get the activation key when Laura by windows vista?

    activation key for windows vista

    How you installed Vista as an upgrade on XP or to perform a new installation? Did you use the installation of a media installation upgrading or complete dvd or did you by TechNet or MSDN subscription paying there?

    With or without a dvd, you must enter the product key that was included with the media or have bought and downloaded via the store Ms. The product key is usually on the plastic case, the dvd of Vista arrives or accompanies electronic download and is that you enter during the installation/update level or when you use the control panel > system > change the product key to see active Windows.

    You'll need a product key valid for the edition in question that you are now going to run.

  • How can I get my contacts from my iPhone and my caledar 5-my 16 Outlook in my Pc with Windows 10?

    How to make my calendar and contacts from my iPhone 5 for my 16 Outlook in my Pc with Windows 10?

    One option is to use iCloud for Windows to synchronize:

    What is iCloud for Windows? -Apple Support

    Download iCloud for Windows - Apple Support

    Set up and use iCloud for Windows - Apple Support

  • getBytesLoaded() and getBytesTotal() return anything when you load content from another domain

    I created a movie that load various media using loadMovie(), then in many cases performs actions on the newly loaded MCs once loading is completed. I rely on getBytesLoaded and getBytesTotal to know when to perform these actions.

    This works very well when the content is on the same server as the film, but I also need to load content from another domain and this is where it falls apart. The media actually does very well in the target MCs, but never make the functions that need to be running when the loading is complete. The problem is that getBytesLoaded() and getBytesTotal() both return nothing when the content is loaded from another domain.

    I'm stuck with loadMovie and getBytesLoaded/getBytesTotal as this film must be published for Flash Player 6, but I actually tried to use loadClip() and onLoadInit() and I get the same problem - onLoadInit() never works.

    Another weird thing is that test by displaying a flash preview is not displayed this problem - the content of fines and getBytesLoaded and getBytesTotal loads two values to return as expected. It's only when I publish the film and display in a browser I have this problem.

    Where I'm going wrong?

    Thank you!

    in your external SWF on the other server, type the following in the first picture...

    Code:

    System.security.allowDomain (_parent._url);

    If you load your swf file into a movieclip with instance name mcImage and then do

    Code:

    System.security.allowDomain (mcImage._url);

  • I want to cut a piece of a picture and paste it into another picture.

    I want to do something in photoshop that is EXTREMELY easy to do in Microsoft Paint, but I can't use paint, because the file size is too large.

    What I want to do is cut a part of the image to a file, and paste it into another file, move to the location I want.

    In painting, I would choose the area I want to cut/copy.

    I'd then cut or copy.

    I then opened the new photo

    I would then paste.  This would cause MS Paint paste the section copied in the upper right of the screen.

    I then propose section glued to the desired location.

    It was very, very, very simple.

    How do these same steps in Photoshop?

    I am a collage.  The pieces of cut/copy range in size.  I have MS Paint, I just stick, then move them.  You don't have to accurately know their size.  I can't do the above in Photoshop using "paste in" because I have to know precisely the size of the portion that I just cut.

    You have the tool to move (V) of the selected?

    Could you please post a screenshot with the Panel visible layers?

  • Change from windows to mac, how can I get the programs I bought for windows?

    Change from windows to mac, how can I get the programs I bought for windows?

    HAV photoshop loose 11 for my windows computer but I have now bought a mac. I can do something to get the program, I have to convert it to mac?

    Hello

    Please see a product for another language or version of trading platform

    Hope that helps!

    Kind regards

    Sheena

  • I have another laptop that I use from time to time, how can I get my photoshop from adobe on it?

    I have another laptop that I use from time to time, how can I get my photoshop from adobe on it?

    Cloud license allows 2 activations http://www.adobe.com/legal/licenses-terms.html

    -Install on a 2nd computer http://forums.adobe.com/thread/1452292?tstart=0

    -Windows or Mac has no importance... 2 on the same operating system or 1 on each

  • How can I get the message from thunderbird to stop coming when I opened my email?

    How can I get the message from thunderbird to stop coming when I opened my email?

    Press the alt key to make the call of menu bar
    Select Tools-Options-general
    Disabled the Start Page

Maybe you are looking for