[js CS5] Find the unknown text using GREP

I am very new to GREP and a little new in InDesign scripting so bear with me if I sound ignorant.

I am trying to create a script that will correspond to a certain point and tag/style to be used in a head race. The paragraph can be, for example: ' unit: plants,' and I want the current title to be simply 'Plants.' So far I've just been through the book and marking of each unit of title to hand, but I would like a script that will go and tag all of the text, after the paragraph 'unit '. The problem is that the book I'm trying is not in English, it's about 15 different languages. The only clue I have on what to tag which is at the beginning of each unit, there are a few short paragraphs English to let me know what camera I'm trying, as follows:

[last paragraph of the previous section]

Unit: Food for the body and mind (complete title)

Unit: Food (short title)

Ushqim (short title in the language for the head of the race)

Ushqim by trupin dhe mendjen (full title in language)

[first paragraph of the trucks]

I have a chart of all the titles of the unit in English, and I thought I could do a GREP find for the short title and a mandatory return and all of the following like this paragraph:

var langUnit = new Array();

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

app.findGrepPreferences.findWhat = "Unit:"+ myArray[i]+"\\r.*?\\r;"

langUnit.push (myDoc.findGrep ()); }

My first thought was that I could then split the resulting strings on the back and the tag the second element of the resulting array, of course I didn't know returns that would throw off the coast, and now I'm stuck.

Let me know if this makes no sense.

Any ideas on how I can proceed?

Your expression "Unit: '+ myArray[i]+"\\r.*?\\r' corresponds to three paragraphs, so you can treat paragraphs [2] to access just the title. " It seems to me that you don't need to look to the English a few titles first: look for simply two consecutive paragraphs starting by "unit:", then take the following paragraph. It is similar to what you are doing, but more simple:

app.findGrepPreferences = null;

app.findGrepPreferences.findWhat = "Unit:.+\\rUnit.+\\r.+";

myFinds = app.activeDocument.findGrep ();

for (i = 0; i< myfinds.length.length;="">

myFinds [i] .appliedCharacterStyle .paragraphs [2] = «...» » ;

Peter

Tags: InDesign

Similar Questions

  • Find the content after the last tab use GREP

    Hi all

    Is it possible to find the content after the last tab use GREP?

    Please see the screenshot below:

    Screenshot, I highlight the required text.

    Screen Shot 2014-05-27 at 5.11.29 PM.png

    Thanks in advance

    Siraj

    Hi Sriaj,

    Try to find this in Grep.

    \t[^\t\r]+$

    Kind regards

    Cognet

  • How to find the security protocol used by a site in firefox to version 24.6.0

    I'm unable to find the security protocol used by the site, either SSL or TLS 1.0 or 1.2.

    I see my answer above is marked as useless, so I guess it doesn't help for Firefox 24.

    You should be able to see which version of the TLS Protocol and encryption to agree to the current use of press.
    You can use the above posted extension or check in the Security tab of the Web Console (Firefox/tools > Web Developer).
    24 Firefox supports only TLS 1.0 (security.tls.version.max = 1), so that only leaves you with Protocol to guess.

    In Firefox 24 you have the Security tab in "tools > Page Info > Security" to see what level of encryption is used, and you do not see what costume of encryption is used.
    To find you would have to disable any combination of encryption algorithm by setting the Pref security.ssls false and allow both until you get a secure connection.

  • Try to find the terms of use of documents and Web pages

    Hi am writing my

    my university thesis. I'll try to find the terms of use on the use of VMware

    diagrams, documentation and Web page in thesis.  Heart of my thesis is

    the best possible instructions how to install and use Labmanager in

    University teaching. No idea how I read, call, or mail?

    I think that you can reuse for educational purposes.  Just follow the correct citation format (APA, MLA, etc.) for the way in which the thesis is written.

    And I see no reason why you can't, as much as it is for the promotion and support of our product.

    Kind regards

    EvilOne

    VMware vExpert 2009

    NOTE: If your question or problem has been resolved, please mark this thread as answered and awarded points accordingly.

  • Find the glyph text editing

    Hello

    I ' am looking for a script which search text and change it to a glyph with a red color for example.

    Something like this:

    Find #H and change glyphs unicode 2665 with fonts ITC Zapf Dingbats Std and name of the red color.

    Find #R and change glyph unicode 2666 with fonts ITC Zapf Dingbats Std and name of the red color.

    Find #K and change glyphs unicode 2663 with fonts ITC Zapf Dingbats Std and black color name.

    #S find and change glyph unicode 2660 with fonts ITC Zapf Dingbats Std and black color name.

    I use Indesign CS6 on mac.

    Kind regards

    Patrick

    Patrick,

    <2600>etc. are Unicode symbols costume, not the glyph ID values. {And confuses you text and Grep ratings for Unicode characters: <2600>is used in the replacements or the \x{2600, the text searches} in Grep. To change symbols and apply character styles, you can use a script like this:

    app.findGrepPreferences = app.changeGrepPreferences = null;
    
    function kleur (afkorting, unicode, stijl) {
      app.findGrepPreferences.findWhat = afkorting;
      app.changeGrepPreferences.changeTo = unicode;
      app.changeGrepPreferences.appliedCharacterStyle = stijl;
      app.activeDocument.changeGrep()
    }
    
    kleur ('#S', '\\x{2660}', 'schoppen');
    kleur ('#H', '\\x{2665}', 'harten');
    kleur ('#R', '\\x{2666}', 'ruiten');
    kleur ('#K', '\\x{2663}', 'klaveren');
    

    Since there is nothing GREPpy what you are looking for you can use find/changeText too, but grep replacements tend to be faster than text replacements.

    Peter

  • I can't find the pdf file using the Edit menu bar | To find

    I can't find a pdf file in Firefox. I select the form to change the bar then find menu in the menu dropdown. I then get a research work in the lower part of the right text box but she blushed and does nothing.

    When I view the same pdf file in Internet Explorer, it works.

    I solved this problem by going to Tools/Options and change the setting of "Adobe Acrobat Document" to "Use Acrobat reader (in Firefox)" to "(by default) use Acrobat Reader.
    Sounds illogical to me, but it works.

  • How to find an object/text using a specific color? HAVE CS4

    Hi all:

    I have a very serious problem. I built a doc using a custom color palette, and then I changed the colors in the palette and modified also all objects and related graphics to the new palette.

    But there is one obsolete color still appearing in my color chart, and I can't remove it try all known ways.

    Therefore, there must be at least one thing that still use this color, hidden hidden somewhere.

    I tore up the doc apart, as well as all the docs of linked graphics and still can not find it.

    Is it possible to find a doc for something else (text, path, object, etc.) that uses a specific color? Less, then, I can find the darn thing.

    Sorry, I forgot to mention. I use CS4 I

    Thanks in advance.

    Hello

    I think that these can be useful...

    Method 1:

    Draw a rectangle with the color box. and go to Select > object > same fill color or Select > object > same outline color, then you can find the similar color objects.so you can easily remove.


    Method2: (If you have acrobat professional)

    Create a PDF file and open this file PDF Acrobat Professional. go to Advanced Options > print > overview of overprinting, keep there only that color. then it shows where you used this color. so that you can easily remove

    hoped it, would be useful...

    HARI

  • bougth a second hand iPhone 6 how find the previous owner using the serial number?

    I bought a second hand iPhone 6 and he holds a lock to iCloud how to find the previous of this iPhone owner so that I can email him?

    I don't have a serial number of the phone how to use it so that I can follow the former owner?

    Unfortunately, you can not. Take it to where you bought it for a refund.

    See you soon

    Pete

  • Couldnot load file or assembly 'sorttbls.nlp' or one of its dependencies. The system cannot find the file specified using SharePoint Designer 2007

    I have a computer on my network when you open web files WSS 3 in SharePoint Designer 2007, I get the error 'could not load file or assembly 'sorttbls.nlp' or one of its dependencies. The system cannot find the specified file. "I have looked through some forms on the web and have concluded that this is a problem of .NET Framework 2, but I have not managed to solve the problem. He also seems to be keep me to load the Update Services administration console on a workstation by using MMC. Other posts on my network can open/edit SharePoint web site files in SharePoint Designer 2007 without this error and open the Administrative Update Services console withpout errors. I tried a repair on .NET 2. Anyone have any suggestions on another approach to fixing .NET?

    Thanks for your suggestions.

    Jeff

    Hello

    -What is the operating system installed on your computer?

    Your Windows XP question is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the IT Pro TechNet public.

    Please ask your question in the Forum on TechNet Support. You can follow the link to your question:
    http://social.technet.Microsoft.com/forums/en-us/sharepointgeneral/threads

  • Where to find the IaaS __Clone_SnapshotId used on plans related clone in the vRA?

    Hi guys,.

    When you create linked clone plans IaaS that iaas will create an entity of VirtualMachineTemplateProperties with the __Clone_SnapshotId PropertyName and PropertyValue of let's say 6.

    This id is used to identify what snapshot to use for the linked clone one can be found in the database of IaaS. However: I can't say this number (6) where in vSphere.

    If the id of the snapshot in vCenter looking then it is, for example, snapshot-7380. Is there a kind of happening of mapping in vRA IaaS between vSphere snapshot ID and the ID snapshot of IaaS? How to get the instant correct ID for IaaS?

    Good so I finally tracked. It looks vRA IAAS using the id of snapshotTree for the clone-related references. If you have access to the VC:VirtualMachineSnapshot you can find the id like this:

    //snap is the provided VC:VirtualMachineSnapshot you want to use as linked clone reference
    var vm = snap.vm;
    var id = snap.id;
    function findSnap(snapTrees, snapId)
    {
      System.log("Searching SnapshotTree for id '" + snapId + "'...");
      for each(snapTree in snapTrees)
      {
      System.log("Checking snapTree '" + snapTree.id + "' with id '" + snapTree.snapshot.id + "'...");
      if(snapTree.snapshot.id == snapId)
      {
      System.log("Found matching snapshot! SnapTree id is: '" + snapTree.id + "'.")
      return snapTree.id;
      }
      else
      {
      var childSnaps = snapTree.childSnapshotList;
      if(childSnaps.length > 0)
      {
      System.log("Checking children...");
      return findSnap(childSnaps, snapId);
      }
      }
      }
      return null;
    }
    
    // Get the id like this
    var snapTreeId = findSnap(vm.snapshot.rootSnapshotList, id);
    

    Hope someone saves some time.

  • Find the last characters with grep

    I'm lousy with grep and didn't find the solution with google, we will so ask here (help me, please...)

    I need to find the last 7 characters in a paragraph and assign a character style "not break". I know that all the rest, but what is the string to find the last 7 characters (white space included, numbers and letters).

    Thanks in advance.

    try searching. {7} $

  • How to find the ADF version used in a deployment archive?

    Hello

    When I get an ear/war file from a developer I want to deploy on a Weblogic Server it would be nice to be able to verify that the ADF version developers used is the same that is installed on the server.

    I tried to look at different deployment files but I can't find anything about it. Can anyone help?

    I can see the JSF version but noting on ADF.

    What about Peter

    I see your problem but do not see how you can get the information of just the EAR file as long as it is not put there by purpose. The required information is part of the jars that are installed on the servers. They are not part of the ear, but are only referenced.

    For the server side, I've written a web service that I install on each server (managed server that runs to the ADF, run time). This service at least tell me the version installed on the server. You can find the service including the source to my blog http://tompeez.wordpress.com/2012/02/05/adf-how-to-find-out-which-adf-version-is-installed-on-a-manged-weblogic-server/.

    There was a discussion on this forum and the ADFEMG google Group discuss how to know what the newer version (from sources of a project) was used to develop the App. Unfortunately, today you can't get a definitive answer to this. There is an ER out for it to allow in the future (http://java.net/jira/browse/ADFEMG-70).

    Timo

  • Find the objects that use a procedure

    I have a procedure within a package. I want to know what are the DB objects use.
    select name  from user_source where upper(text) like upper('%procedurename%');
    

    Try this...

  • Align the text in the dynamic text using HTML box

    Hello

    I'm importing text to mysql through php, for an area of dynamic text in flash. I can't text from column 2 to align to the left. It comes out like this:
    Column 1 column 2
    James Kearns
    Mary Peterson
    Thomas Clark

    The php code I have is:
    print ("& dbpages =");
    While ($row = {mysql_fetch_array ($result, MYSQL_ASSOC))}
    Print "< table >. $row ["FirstName"]. "". "< tr > < td align = left > '." $row ['name']. "< table > < /tr > < / table >". " » \n » ;
    }

    The AS code is:

    Where database_txt is the dynamic text box.
    How can I align column 2?

    Thank you
    Paul

    Thanks for your comments.
    I used the tag to format text and solved the problem. In the PHP code I used the tab stops \t. It aligns data in Flash.
    PHP code should now be:
    Print ("& dbpages =");
    While ($row = {mysql_fetch_array ($result, MYSQL_ASSOC))}
    Print "\t".$row['first_name"]. '\t'.» $row ['name']. » \n » ;
    }

    The Flash code is now:

    var resultPages_LV:LoadVars = new LoadVars();
    resultPages_LV.onLoad = function (success: Boolean) {}
    If (success) {}
    var myformat:TextFormat = new TextFormat();
    myformat.tabStops = [20 140];
    database_txt.htmlText = true;
    database_txt.htmlText = resultPages_LV.dbpages;
    database_txt.setTextFormat (myFormat);
    }

  • How can I find the serial number used to install photoshop elements

    I'm moving to a new computer and can't find the serial number for Photoshop Elements.  I have full access to the old machine and downloaded from Adobe for the new machine.

    Hi securemail

    Check this box: quickly find your serial number

    concerning

Maybe you are looking for

  • CalendarAgent / Mail / Calendar Agent El Cap errors

    Getting a LOT of errors in my logs on Mail and CalendarAgent.  El Cap 10.11.5 running (a colleagues machine is on 10.11.4 with the same problem). Local running calendar and e-mail exchange.  Also runs e-mail and calendar Gmail accounts. tried to dele

  • I want to buy 18 "4 Qosmio X 500"

    I am looking to buy a 18 "4 Qosmio to replace my old G50-136 and thought on one of the X 500 series, but I just cannot find anywhere any sheet related to the series of all. I am looking for an i7-2620QM or better with a HM65 express or better.Anyone

  • Port of charger broken on Satellite L500-1XD

    Hi my laptop L500-1XD fell about 6 inches on the carpet, he was in charge at the time, and the charger port seems to be cracked which means that the charger will not stay in and it will not load. Can you tell me please if it is possible to replace th

  • my color ink cartridge is full but does not work

    my color print cartridge is full and checked and I mark color printing, but it will only print in black and white? help```````````````````````````````````````````````````````````````````````````1

  • DeskJet 3320 on long vacation

    My otherwise perfect deskjet 3325 has been standing idle for a few months. I am now in a situation where I have TO use it again. Apparently, there is ink in the cartridges, BUT the paper comes out of the Virgin, even after several CLEANING operations