How to search string in the window layout and paste it inside the element?

I'm new to indesign to animals. Learn extendscript for automation.

I need to paste a string copied instead of '< media >' element in the window layout like the image below.

inde.JPG

But I do not know how findgrep in window(ctrl+y) layout rather than the editor.

I have a script to copy - paste into the active document at the specific position of specfic chain. But, I need to glue between the element of "< media > < / media > '."

For example:

If search string = "FIG. 1.1", so I want the copied string to be pasted into the document as below

WINDOW LAYOUT:

< media.block id = "001" Fig. > < media > < / media >

< caption aid: pstyle = "Caption" > < num > FIG. 1.1 & #x2002; < / num >

< para > < txt > the range of disciplines engaged in research and development

in the field of nanoscience and technology. < / txt > < / para > < / legend > < media.block >

OUTPUT:

< media.block id = "Fig001" > < media > * PASTE STRING * < / media >

< caption aid: pstyle = "Caption" > < num > FIG. 1.1 & #x2002; < / num >

< para > < txt > the range of disciplines engaged in research and development

in the field of nanoscience and technology. < / txt > < / para > < / legend > < media.block >

I have a script to paste into the current document rather than the window layout.

App.Open (file (myFigDoc));

app.activeDocument.pageItems.everyItem () .select ();

App.Copy ();

app.activeDocument.close ();

app.findGrepPreferences = app.changeGrepPreferences = null;

var figString = "FIG." + chapno + "'." + j; "

app.findGrepPreferences.findWhat = figString; Figure legend text

app.findGrepPreferences.appliedParagraphStyle = "FigureCaption"; Figure caption Style

myFinds = app.activeDocument.findGrep ();

for (var i = 0; i < myFinds.length; i ++) {}

myFinds[i].insertionPoints[0].contents="\r ';

myFinds [i] .insertionPoints [0] .select ();

App.Paste ();

}

How do in the window layout?

Try this,

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;

var myDoc = File("/D/template-sample.indd");//Figure File
var myFigDoc = File("/D/fig1.indd");//Destination File

app.open(File(myFigDoc));
app.activeDocument.pageItems.everyItem().select();
myObj = app.selection;
app.copy();

app.open(File(myDoc));
app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.findWhat = "FIG. 1.1";//Figure caption text
app.findGrepPreferences.appliedParagraphStyle = "Caption";//Figure Caption Style
myFinds = app.activeDocument.findGrep();
alert(myFinds.length)
for(var i=0;i 
         

Tags: InDesign

Similar Questions

  • How to get my key of windows 8 and reinstalled it on my computer?

    I bought a laptop with a windows pre-installed 8 and had it upgraded to 8.1. Unfortunately my bios and the hard drive crashed. I got the bios re-installed and replaced hard drive but I don't have my windows key 8 that my laptop did not come with a sticker. How to get my key of windows 8 and reinstalled it on my computer?

    OT: recovery of windows 8

    Hey fatty,.

    What is the brand and model of the computer?

    Windows 8 is a preinstalled version, you must contact the manufacturer of your laptop to get the product key. As OEM (original equipment manufacturer) product keys be provided by the manufacturer of the computer.

    I hope this helps. Let us know if you have other problems with Windows in the future.

  • FAQ as a search scope for the elements of literature

    Sort of create a FAQ as a search scope for the elements of literature?  The idea is that the site visitors would be able to choose a category, subcategory of items of literature before being presented with the list of items in that category or subcategory.

    Not with the system in the State.

    You can include items from the media module manually in a response from the FAQ (manual add to FAQ with links customized wysisyg) or past the {module_literature, c, insertclassificationidhere,} call in the tag content / source.

    Another option would be to create a HTML page containing tags downloads media (filtering on a classification) of block elements and then manipulate the presentation with javascript. Example would be the tabs or accordion layout each element in the appropriate media downloads by category.

    You can also create pages that have done the same and then pull them in an element of presentation with Ajax calls in another page.

  • How to search with options in Windows 7?

    I'm trying to search for a file, but with options to filter a search.  So I click on the start menu button and enter the name of the file as possible.  BUT, I want to enter a date range, an extension or the keyword that may be in the file.  I've been able to do in previous versions of Windows, but don't know how or where to do in Windows 7.  I even went to Windows Explorer, but it is impossible to find a place to do it.  Can someone tell me please how to do this?  I would be very happy.  Thank you!!!

    When you click on (or type the word) of type, you should get a drop-down list of the file types (same as extensions).  This small list might take a short time (a few seconds) appears, because it scans the registry to load all the extensions of known file types.

    Also there is such option, which is really just a logical group of types.  So, for example, if you are looking for type: photo, he would get all images, regardless of the type of file real itself.  BMP, PNG, GIF, JPG, all known image files.  So, really, the kind is just a bigger lasso net around 'type', if that makes sense.

  • Search string in the schema

    I want to find a no.201020 error in a schema. Please suggest how to search the string in a schema.

    Sanjay

    Select name, often from user_source where text like '% errror_number % '.

  • How to remove one of the elements of operating system of Windows Start menu?

    Original title: choose an operating system to start, or press Tab to select a tool. _ (use the arrow keys to highlight your choice, then press enter) windows Vista__Microsoft windows Vista __Microsoft

    How to remove 1 of the operating system for each time I start the computer, I dun hv to click on the 1st system?

    Thanks for the help

    Hi the user Noob,

    We recommend that you remove the entry that allows Windows to start successfully. Microsoft Windows Vista (C:\Windows) is the default. You can remove the second entry and check the result (delete if it does not work).

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • How to concatenate strings with the lines of a text file

    Hello
    I tried concatenate strings with the lines of a text file, but something is wrong with my code and I belive is the agruments I use in the cycle for. If anyone can help me I will appreciate it very much.
    My code is:
    [code]@echo off
    the value "input=C:\Users\123\Desktop\List.txt".
    for /f "usebackq tokens = *" % in (' input % ') do)
    the value 'str1 = C:\some directory\ ".
    the value ' str2 = %% ~ F '.
    the value "str3 = .pdf".
    the value "str4 = str1% str2% str3%.
    echo.%STR4%
    ) [/ code]
    and the text file is something like:
    121122 [code]
    122233
    123344
    124455 [/ code]
    But I get only one wrong answer and I have to run it like 3 times to get a real result and it is a mistake, the first two are empty spaces and gives the third one as the last line of the text file but repeated n times, where n is the number of lines in the text file.
    Result:
    [code] C:\Users\123\Desktop>concatenate.bat
    C:\Users\123\Desktop>concatenate.bat
    C:\Users\123\Desktop>concatenate.bat
    C:\some directory\124455.pdf
    C:\some directory\124455.pdf
    C:\some directory\124455.pdf
    C:\some directory\124455.pdf
    C:\some directory\124455.pdf
    C:\Users\123\Desktop>[/code]
    So if anyone has an idea about what is wrong please let me know.
    Concerning
    -Victor-

    Hi Victor,

    This forum is dedicated to the support of the Office of consumer Windows (fonts, colors, personal settings).  Since your question is about programming and usually outside the context of most of the customers, I suggest you post your question in the forums as http://msdn.microsoft.com - the Microsoft network to users will be more adapted to help you in your quest.
  • How to display strings in the array of strings 1-d double

    I have some strings in the string table 1 d and I need to display channels duplciate present in the array of strings 1 d... pls let me know... I'm using labview 2010 worm

    Matt wrote:

    I have attached the VI

    Well, there are several possible solution. Do you think all the elelemts that are not in the course of exit or do you only each. For example, if the table contains 3 of the same element, do you want twice in the double output?

    I suppose you want only there once, so just the existing code to scale accordingly. See attached example. If you want all, remove the internal node of case and research and blindly add all items in doubles.

    Note that there is full of the most effective ways to do this, but the current code is sufficient for small tables.

  • How to lower offer upgrade to Windows 10 and stop offer popup?

    I have Windows 7 and I'm happy with it: no upgrade needed. However, an offer to upgrade to Windows 10 is constantly popping up despite my pop-up at the wide turn. How lowered the offer to upgrade to Windows 10 and stop offers pop up?

    Thanks in advance,

    Ljubisa

    Go to Windows updates | View the update history | Installed updates. KB3035583 (caqn you use the search bar) to find and uninstall. Reboot and go back to WU and hide the update.
     
  • How can I dual boot version Windows 8 and windows 7 Professional

    How to create a partition dual boot?

    I now have windows 7 pro now. I want to have a dual boot for win 7 & win 8.

    I lose all my apps of win 7, & will be working on win 8 automatically or do havve to re - install in win 8?

    Please see:

    http://www.PCWorld.com/article/2012070/how-to-dual-boot-Windows-8-and-Windows-7.html

    Othe tutorials are available on the Internet. Do a Bing, Google or similar search
    dual boot Windows 7 Windows 8.

    The installation of Windows 8 on a drive separate partition/logic will not affect any aspect of your Windows 7 Professional system. You will need to install all the applications for use with Windows 8 on this system with the system of Windows 8 running. Some people, it is useful to create yet another disk partition separated/logic for their documents, pictures, videos and files of the user. Thay can be shared between the two systems, open and modified either by, according to the needs.

    Good luck.

    Tom Ferguson

  • "How to remove scanners listed in Windows Fax and Scan App under 'Tools' - &#62;"Scan Routing? '"

    My question is very simple: I believe!  How can I remove scanners listed in Windows Fax and Scan App under 'Tools'-> 'Scan routing?  This really should not be so dang hard when I do an install, and regedit, I looked at most of the places are to get rid of any residue.  However, when I get back in Windows FAX and Scan, inevitiably I see printers / scanners way back when I bought this laptop.

    I use Windows 7 Home Premium as my operating system.

    I think I'll try the following:

    Uninstall Norton & reboot

    Reinstall your HP printer using the latest version of the full software features on HP site, preferably in the usb connection.

    Test the printer or use HP diagnostics to test its operation, then uninstall HP printing via programs & features software.

    Then use the HP utility to completely re - move

    http://h10025.www1.HP.com/ewfrf/wc/softwareDownloadIndex?CC=UK&LC=en&DLC=en&softwareitem=MP-49133-2

    If all goes well, that should put an end to this

    (With the help of uninstalling programs & features should remove the printer from the "Devices and Printers")

  • "No preview available": there are several files that I need to be able to preview and search for text that Windows 7 (and previous Windows) does not.

    original title: "no preview available".

    There are fixes for older versions, but not Windows 7, I can find.  When I search the forums, the answers are pretty useless - along the lines of "well go on the forum of office" just because someone questioned the .doc files.  It is an old problem, old with MS and covered needs in a reasonable manner.

    Read this:

    No preview available for some files in the folder in Windows 7 and Vista Zip
    MRI http://www.Winhelponline.com/blog/no-Preview-available-certain-Files-zip-Folder-View-Windows-7-Vista/ !

  • How can I view all the elements of an array?

    Hello

    I'm learning about the handling of tables.  The example finder includes this one, 'build array_forum.vi', which shows the two modes, concatenate and adding, I understand, HOWEVER, I can't understand how they built this vi.  For example, I can find the Array function to build, but I do not understand how they created the "digital data table 1" "data table 2" digital... etc, and I can't find the functions on the pallets that cause display "build the CONCATENATE entries table". ".  Where are these blue functions?

    Where these functions are found in the palette, and how we build them like that?

    The other vi indicated here, 'for loop array_forum.vi' is my attempt to reproduce, but it doesn't show all the elements of the array; However, it only displays a SINGLE element, the last element of the array.  How can I view all the items in the table I am creating using the FOR LOOP?

    Thank you

    Dave

    I think I posted this in the wrong place.  I reposted it on the forum of Labview.

    Dave

  • How to disable automatic sorting in windows 7 - cut / paste issue

    Hello

    I use a folder image with thumbnails with files in numerical order.

    I can manually drag and drop the file from one place to another without automatic sorting.

    That is to say. I can drag the first file in the folder at the end of the list.

    But when I use cut and paste, the file does not move and stays in the same order.

    Is there a way to change its behavior like xp... where do drag and drop, or cut and paste works the same way?

    Thank you for any advise on this topic.

    William

    For those of you who are gifted in registry, visit this link:

    http://www.Winhelponline.com/blog/disable-full-row-select-Explorer-Windows-7/

    Yes; It IS a resolution.  (Scroll down to "#4)  It is not very complicated; Just follow the step by step instructions.  I don't usually respond to forums, but Microsoft really screwed the dog on this one then as a fellow Windows-user, I feel obligated to share the possible resolutions.

    Knowing Microsoft, they will empty this page to try to prevent some users to solve this annoying problem, so I suggest to copy the content of the link and stick to one. DOC or. TXT and share it on other sites there is.

  • How to get pictures of the elements Organizer. Didn't know that I could leave it in IPhoto and just edit with elements.

    I imported all my photos from IPhoto into the elements Organizer until I read enough to see that I could use the only editor with the help of the Organizer. How can I get my photos out of the Organizer?

    Nice day!

    Please post related queries from Photoshop Elements

    http://forums.Adobe.com/community/photoshop_elements

    Kind regards

    Pfaffenbichler

Maybe you are looking for

  • IPhone locked by ID in Icloud.

    Dear ladies and gentlemen, How can I know the former owner or coordinated for iphone email which locked by icloud id? waiting for your urgent response and thank you for your cooperation. Kind regards Samir Horani.

  • Move photos

    I have an ipone SE. I want to move the photos to another album, not copy them. I don't know how... hope someone can help me :-) melpie bibihunter

  • Satellite M70 354: how to change the display?

    Hello!My TFT-Display of my Satellite M70 354 is physically broken. So I need a new. The Servicepartner costs of a new view without working time are EUR 450,-(!). It's too. Is a change to myself as possible, or is it very difficult? On Ebay, I found a

  • Change/Remove primary parent

    Hello I need to change the primary parent on behalf of Microsoft family safety from one parent to another parent. How can this be accomplished? Thank you Arlo

  • My binocular camera software will not download, it is useful to Windows xp

    I have binoculars digital camera, when I put the software to download, first of all, he said at the end of the reading, the software program is not found, then tried again and it runs like its reading software, but nothing happens, the software is gr