Search for a string in the data merge, and then change the font color

I'm working on an invitation from style postcard with the addresses overleaf. So far, I got the invitation and the mail-side with a fusion of data model to a CSV file successfully. Now, as part of my design, I want all the s of the letter 'b' on the model of mail-side (data fusion) of yellow color. The use of JavaScript is it possible? That's what I have so far, but something is wrong:

app.findTextPrefences = NothingEnum.NOTHING as FindTextPreference;

app.changeTextPrefences = NothingEnum.NOTHING as ChangeTextPreference;

var myColor:Color = myDocument.colors.add ();

myColor.model = ColorModel.PROCESS;

myColor.space = ColorSpace.CMYK;

myColor.colorValue = [0, 0, 100, 16];

app.findChangeTextOptions.caseSensitive = false;

app.findChangeTextOptions.includeFootnotes = false;

app.findChangeTextOptions.includeHiddenLayers = false;

app.findChangeTextOptions.includeLockedLayersForFind = false;

app.findChangeTextOptions.includeLockedStoriesForFind = false;

app.findChangeTextOptions.includeMasterPages = false;

app.findChangeTextOptions.wholeWord = false;

app.findTextPrefences.findWhat = 'b ';.

app.changeTextPrefences.fillColor = myColor;

app.findTextPrefences = NothingEnum.NOTHING as FindTextPreference;

app.changeTextPrefences = NothingEnum.NOTHING as ChangeTextPreference;

Hello

After you set the preferences you must call the changeText() method, as

myDoc.changeText ();

or

myStory.changeText ();

But it is a static solution.

You can use a dynamic solution to define a good characterStyle and take advantage of the nestedGrepStyle style applied to this part of your design.

For each character 'b' could be applied with your characterStyle automatically, no need to run a script.

Jarek

Tags: InDesign

Similar Questions

  • How to search for a string in the order reversed through REGEXP_INSTR

    Hi all

    I have the SQL query in which I want to get the first position of the occurrence of the end of the string

    for example:
    String:NBANK-ASD-00-1001-525-1002
    Condition: the position of the character '-' the last. (Note: character can also be '-' or ' / ')
    output: 1002

    for above condition, I have a request next return


    SELECT SUBSTR('NBANK-ASD-00-1001-525-1002',REGEXP_INSTR('NBANK-ASD-00-1001-525-1002','[^-/]',1),LENGTH('NBANK-ASD-00-1001-525-1002 ')) FROM dual;



    but I'm getting more results

    NBANK-ASD-00-1001-525-1002
    means that the expression returns 0...

    pls help me solve this problem.

    You can change your query as follows

     SELECT SUBSTR('NBANK-ASD-00-1001-525-1002'
       , REGEXP_INSTR('NBANK-ASD-00-1001-525-1002', '[^-/]*$', 1)
       , LENGTH('NBANK-ASD-00-1001-525-1002'))
       FROM dual;
    ;
    

    but you can just use REGEXP_SUBSTR to get the same result...

     SELECT REGEXP_SUBSTR('NBANK-ASD-00-1001-525-1002', '[^-/]*$', 1)
       FROM dual;
    ;
    

    Kind regards
    Bob

  • Under XP I could search for a string in all the files on my computer. I can't find this search function of SMEs on Windows 7. Anyone?

    On Windows XP, there is a search function to search for a string in any kind of files on your computer. You are looking for a specific name was easy, if you fogort what kind of file, this name occurred in or what it was named.

    On Windows 7 it only allows searching for a name of a file.  How to search for strings in file names?  29/12/12 Paul Figueroa

    Oh, what you want is the content property.

    content: ~ = Figueroa

    [Update: apparently special search symbols such as ~ = do not work with the content when property indexed research places, but work during the search in unindexed locations.]

    I should mention that Windows 7 Search is not case sensitive, so it makes no difference to try to find upper or lower case letters.  In addition, Windows 7 Search is not able to search the contents of files that have no file extension.  There is also a weird question having to watch in Indexing Options to determine which file extensions are defined for content, research, where you have a type of unusual file that is not defined for the content of the search.

  • How can I tell the mail client to search for new mail on the server?

    How can I tell the mail client to search for new mail on the server?

    Within the Mail app and display the Inbox you can pull down on the list of e-mail using your finger and you should see a small reel spinning gear. Which indicates that his check new email.

    You can also go into the settings of e-mail and calendars Contacts and view the settings there. Examine the settings of "search for new data. If the Push is enabled, then messages will be pushed to you if the email provider supports this feature. You can also set your accounts to use Fetch and set the frequency, he's going to go out and look for new e-mail messages.

  • Search for page elements in a specific layer, and not in the entire document

    Hello

    could you please help me to modify this script, then it can look only to the elements of the page ("Date", "Time", "Version", 'Code of component Ops') in a single specific layer named "Legend" instead of all the layers?

    /**********************************************************
    
    
    ADOBE SYSTEMS INCORPORATED 
    Copyright 2005-2006 Adobe Systems Incorporated 
    All Rights Reserved 
    
    
    NOTICE:  Adobe permits you to use, modify, and 
    distribute this file in accordance with the terms
    of the Adobe license agreement accompanying it.  
    If you have received this file from a source 
    other than Adobe, then your use, modification,
    or distribution of it requires the prior 
    written permission of Adobe. 
    
    
    *********************************************************/
    
    
    /** Saves every document open in Illustrator
      as a PDF file in a user specified folder.
    */
    
    
    // Main Code [Execution of script begins here]
    try {
      // uncomment to suppress Illustrator warning dialogs
      // app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
    
    
      if (app.documents.length > 0 ) 
      {
      var options, i, sourceDoc, targetFile,;
    
      // Get the PDF options to be used
      options = this.getOptions();
      if (options != null) 
      {
      sourceDoc = app.activeDocument; // returns the document object
      var fullName = sourceDoc.fullName;
      fullName = fullName.toString();
    
      var destFolder = fullName.slice(0,fullName.lastIndexOf("/"))
      var dateFound = false;
      var versionFromName = fullName.slice(fullName.lastIndexOf("-")+1, fullName.lastIndexOf("_"));
      var opsFromName = fullName.slice(fullName.lastIndexOf("/")+1, fullName.lastIndexOf("-"));
      var theVersionNumber = null;
      var dateField = null;
      var timeField = null;
      var opsVersionCode = null;
      for(i=0; i<sourceDoc.pageItems.length;i++)
      {
      if (sourceDoc.pageItems[i].note == "Date") 
      {
      dateField = sourceDoc.pageItems[i];
      }
      if (sourceDoc.pageItems[i].note == "Time") 
      {
      timeField = sourceDoc.pageItems[i];
      }
      if (sourceDoc.pageItems[i].note == "Version") 
      {
      theVersionNumber = sourceDoc.pageItems[i].contents;
      }
      if (sourceDoc.pageItems[i].note == "Ops Component Code")
      {
      opsVersionCode = sourceDoc.pageItems[i].contents;
      }
    
      }
      if (theVersionNumber == versionFromName)
      {
      if (opsVersionCode == opsFromName)
      {
      if (dateField == null)
      {
      alert('No tagged date field found. Tag field and try again.')
      }
      else
      {
      dateField.contents = TodayDate()
      timeField.contents = TodayTime()
      OLtargetFile = this.getTargetFile(sourceDoc.name, '.pdf', destFolder);
      sourceDoc.saveAs( OLtargetFile, options)
      // alert( 'Documents saved as PDF' );
      }
      }
      else
      {
      alert('Ops component code in boiler does not match file name or is not tagged. Please correct and try again.')
      }
      }
      else
      {
                    
      alert('Version number in boiler does not match file name or is not tagged. Please correct and try again.')
      }
      }
      else 
      {
      alert('User aborted')
      }
    
      }
      else
      {
      throw new Error('There are no document open!');
      }
    }
    catch(e) {
      alert( e.message, "Script Alert", true);
    }
    
    
    /** Returns the options to be used for the generated files.
      @return PDFSaveOptions object
    */
    function getOptions()
    {
    
    
    
    
    
      // Create the required options object
      var options = new PDFSaveOptions();
      // See PDFSaveOptions in the JavaScript Reference for available options
      options.pDFPreset = "AZ"
    
    
      // For example, uncomment to set the compatibility of the generated pdf to Acrobat 7 (PDF 1.6)
      // options.compatibility = PDFCompatibility.ACROBAT7;
    
      // For example, uncomment to view the pdfs in Acrobat after conversion
      // options.viewAfterSaving = true;
    
      return options;
    }
    
    
    function abortFunction(){
    
      modUI = null;
      dlg.hide();
      return null;
      }
    /** Returns the file to save or export the document into.
      @param docName the name of the document
      @param ext the extension the file extension to be applied
      @param destFolder the output folder
      @return File object
    */
    function getTargetFile(docName, ext, destFolder) {
      var newName = "";
    
    
      // if name has no dot (and hence no extension),
      // just append the extension
      if (docName.indexOf('.') < 0) {
      newName = docName + ext;
      } else {
      var dot = docName.lastIndexOf('.');
      newName += docName.substring(0, dot);
      newName += ext;
      }
    
      // Create the file object to save to
      var myFile = new File( destFolder + '/' + newName );
    
      // Preflight access rights
      if (myFile.open("w")) {
      myFile.close();
      }
      else {
      throw new Error('Access is denied');
      }
      return myFile;
    }
    
    
    function TodayDate(){
      var Dateformat = "dd mm yyyy";
      nameMonths = true;
    
    
       var monthNames = ["January","February","March","April","May","June","July","August","September","October","November","December"];
       var Today = new Date();
       var Day = Today.getDate();
       if(nameMonths == true){
       var Month = monthNames[Today.getMonth()];
       } else {
       var Month = Today.getMonth() + 1;}
    
       var Year = Today.getYear();
       var PreMon = ((Month < 10) ? "0" : "");
       var PreDay = ((Day < 10) ? "0" : "");
       var Hour = Today.getHours();
       var Min = Today.getMinutes();
       var Sec = Today.getSeconds();
       if(Year < 999) Year += 1900;
       var theDate = Dateformat.replace(/dd/,PreDay+Day);
       theDate = theDate.replace(/mm/,PreMon+Month);
       theDate = theDate.replace(/d/,Day);
       //theDate = theDate.replace(/m/,Month);
       theDate = theDate.replace(/yyyy/,Year);
       theDate = theDate.replace(/yy/,Year.toString().substr(2,2));
       if(Hour==0){
      Hour = "12";
      theDate = theDate.replace(/XX/,"AM");
       }else if(Hour>12){
       Hour = (Hour-12);
       theDate = theDate.replace(/XX/,"PM");
       }else{
       theDate = theDate.replace(/XX/,"AM");
       }
       var preSec = ((Sec < 10) ? "0" : "");
       var preHour = ((Hour < 10) ? "0" : "");
       var preMin = ((Min < 10) ? "0" : "");
       theDate = theDate.replace(/hr/,preHour+Hour);
       theDate = theDate.replace(/Mn/,preMin+Min);
       theDate = theDate.replace(/sc/,preSec+Sec);
       return theDate;
    }
    
    
    function TodayTime(){
      var Dateformat = "hr:Mn";
      nameMonths = false;
    
    
       var monthNames = ["January","February","March","April","May","June","July","August","September","October","November","December"];
       var Today = new Date();
       var Day = Today.getDate();
       if(nameMonths == true){
       var Month = monthNames[Today.getMonth()];
       } else {
       var Month = Today.getMonth() + 1;}
    
       var Year = Today.getYear();
       var PreMon = "";//((Month < 10) ? "0" : "");
       var PreDay = ((Day < 10) ? "0" : "");
       var Hour = Today.getHours();
       var Min = Today.getMinutes();
       var Sec = Today.getSeconds();
       if(Year < 999) Year += 1900;
       var theDate = Dateformat.replace(/dd/,PreDay+Day);
       theDate = theDate.replace(/mm/,PreMon+Month);
       theDate = theDate.replace(/d/,Day);
       theDate = theDate.replace(/m/,Month);
       theDate = theDate.replace(/yyyy/,Year);
       theDate = theDate.replace(/yy/,Year.toString().substr(2,2));
       if(Hour==0){
      Hour = "12";
      theDate = theDate.replace(/XX/);
       }else{
       theDate = theDate.replace(/XX/);
       }
       var preSec = ((Sec < 10) ? "0" : "");
       var preHour = ((Hour < 10) ? "0" : "");
       var preMin = ((Min < 10) ? "0" : "");
       theDate = theDate.replace(/hr/,preHour+Hour);
       theDate = theDate.replace(/Mn/,preMin+Min);
       theDate = theDate.replace(/sc/,preSec+Sec);
       return theDate;
    }
    

    You can target the layer to search, add a line before you right pageitems loop, and then change the new target in your loop

      var targetLayer = sourceDoc.layers['Legend']; // ** added
    
      for(i=0; i		   
  • I have a new time capsule airport. How to limit the search for who can use the time capsule backup process?

    I have a new time capsule airport. How to limit the search for who can use the time capsule backup process?

    Set a password to disk... disk tab in the utility... and just give to those you want to use the TC...

  • Windows cannot find C:\WINDOWS\system32\rundll.exe. Make sure you typed the name correstly and then try again. To search for a file check the Start button and then click search.

    I tried to launch my Spysweeper and found that is not there, then I re downloaded and I could not install it because it was already on my computer.  I went to the control panel to remove and got the message:

    Windows cannot find C:\WINDOWS\system32\rundll32.exe.  Make sure you typed the name correctly and then try again.  To search for a file, select the Start button and then check the search...

    What should I do?

    Hi gsrow,

    You can go there!

    Cannot find the Rundll32.exe file when you open the control panel:
    http://support.Microsoft.com/kb/812340

    Alternatively, copy the folder C:\Windows\System32\DllCache Rundll32.exe file to the System32 folder. Ramesh Srinivasan, Microsoft MVP [Windows Desktop Experience]

  • When you search for available updates on the update site, I receive the 0x800A0046 error.

    HELP 0X800A0046

    How to ask a question
    http://support.Microsoft.com/kb/555375 >

    It helps those answering questions if you provide:

    What is your full version of windows (32-bit or 64-bit) and service pack level. (Right-click on my computer and select properties: Windows version which is displayed on the general tab that results (for example, Windows XP Professional Service Pack 1;)) Windows Vista Edition SP2 family)?

    You use what browser (exact version).

    What application anti-virus or security suite is installed and your current subscription?

    A 3rd party firewall is used instead the native Windows Firewall?

    What other software products anti-malware are installed and running?

    What updates you trying to install? (Number of KB)

    Please do it in your next reply.

    Information you provide will help someone to provide you with a relevant solution

    What are the causes of error 0x800a0046

    0x800a0046.html http://www.updatexp.com/>

    -

    December 16, 2005 when looking for updates available on the update site, you receive the 0x800A0046 error.

    http://update.Microsoft.com/windowsupdate/v6/showarticle.aspx?articleid=20&LN=EN>

    - -- ---

    February 7, 2006 error message when you visit the Windows Update Web site or the Microsoft Update Web site:

    "0x800A0046".

    http://support.Microsoft.com/kb/910338/en-us>

    --

    July 2, 2010, you may receive an error message when you search for available updates on the Windows Update Web site or on the Microsoft Update Web site

    http://support.Microsoft.com/?kbid=883821>

    In most situations where the automatic updates and the system restore does not work, the usual causes are installed antivirus\security suite or malware.

    run a CHKDSK followed by a defrag after anti-malware analysis good or two.

    I recommend to download and install MalwareBytes' anti-malware (MBAM) and SUPERAntiSpyware (SAS).

    Do a FULL scan with MalwareBytes' and SUPERAntiSpyware.

    <>>

    http://www.Malwarebytes.org/MBAM.php

    Reset

    <>>

    http://www.SUPERAntiSpyware.com/

    Reset

    UTC/GMT is 02:23 on Saturday, February 25, 2012

  • Search for files by using the Start button

    I've lost the ability to search for files by using the Start button.  I can enter a file name, but always get a response "nothing found".  I know I did something back a couple of weeks, but don't know what I did to turn it off. Help!

    Thank you!

    Take a look at my search installation tips.  If you are in these settings, you can make sure search is enabled and if necessary you can use the 'reconstruction' of the for button to rebuild your search system.

    http://Skeene.NET/tech/boost-Windows-search-in-two-steps/

    Also, there is an automated troubleshooting tool that tries to find and fix any problems with your search system.  You can go for it here:

    http://support.Microsoft.com/mats/windows_search/

  • Search for blackBerry Smartphones Addressbook - the function "search".

    "Find" my address book function does not work.  I have a 1000 contacts and anything (that) I'm trying to look upwards until it says * no. addresses *.

    I checked the filter function and nothing is selected.  Any thoughts?

    Thank you

    Richard256

    Hello Richard,.

    You can try to reset the device by removing the battery for 30 seconds, then replace it. After restarting the device, try to search for a person in the address book.

  • My computer crashed and after the purchase of another, I used the Migration Wizard to copy all the files to the new computer.  Everything was going well until I tried to launch LR6.  It was two weeks ago and a search for many pages of the Adobe Web site. 

    My computer crashed and after the purchase of another, I used the Migration Wizard to copy all the files to the new computer.  Everything was going well until I tried to launch LR6.  It was two weeks ago and a search for many pages of the Adobe Web site.  I think I've exhausted all the remedies listed without success codes error A12E5 to questions cloud creative, Manager of Application and error 1: Configuration problems.  I'm ready to reformat my computer and try again with Time Machine.  Help would be greatly appreciated before I waste more time on this task. Any further suggestions?

    Migration of Mac with Time Machine WILL NOT WORK with the Adobe program activations due to hidden registration files

    Sign out of your account... Uninstall... to run vacuuming...

    -non-Cloud programs, to disable the service before uninstalling

    -http://helpx.adobe.com/creative-cloud/help/install-apps.html (and uninstall)

    -using the vacuuming after uninstalling and before reinstalling is often necessary

    -https://helpx.adobe.com/creative-suite/kb/cs5-cleaner-tool-installation-problems.html

    -Restart your computer... Sign in to your account... Reinstall

  • Convert the Period_Name in GL_JE_Lines table to a date format and then come back year

    I'm working on a data model BI Publisher and I try to convert the Period_Name in GL_JE_Lines table to a date format and then return of the year.

    The sql below works in 11i, but I can't make it work in Fusion.

    to_char (to_date (l. )) period_name , ' MON-RR ' ),'YYYY')

    Any ideas?

    Hi Jennifer,.

    To_char (sysdate, 'DDMONYYYY') in BI Publisher does not return a correct results due NLS_DATE_FORMAT/DATE_LANGUAGE settings.

    According to the standards of the I18N, NLS_DATE_LANGUAGE in the database is still hardcoded to NUMERIC_DATE_LANGUAGE. NUMERIC_DATE_LANGUAGE 'MY' in a date format mask is an integer, so you see the correct value.

    You're not supposed to publish direct SQL with fixΘe format masks (unless it's some sort of canonical format used in internal processing, including the end-user will not be), you should return language digital date to the mid range and then make the formatting of y.

    Workaround

    Try adjusting the NLS_LANGUAGE in SQL data model to override formatting from of the

    Data base and values of the Session, for ex: select to_char (sysdate, 'MON-DD-YYYY', 'NLS_DATE_LANGUAGE = AMERICAN') of double;

    I got this Oracle support after lifting a SR.

    Thank you

    Rahul.

  • Change the font color in a report using SQL for APEX 5.0 queries

    Hello

    I'm testing APEX 5.0 in my test environment to see if I can migrate my internal applications of 4.2 to 5.0.

    How can I change the font color in a field based the SQL query? I know how to do it in 4.2, but I can't find the same in 5.0.

    Thank you

    Well, I used to put html tags in the select text, getting the value of depending on the CASE, so I had to change the display column attribute in the report as "Display in text form (space special characters...)".

    I found an old post here: https://tylermuth.wordpress.com/2007/12/01/conditional-column-formatting-in-apex/ and this method still worked for me in APEX 5.0

    Thanks anyway

  • How can I change the font color on incoming emails

    I would like to change the font color from black (default color) to a blue color on incoming and outgoing emails.

    Hello


    1. What mail client do you use? Is - this client is Microsoft outlook e-mail or on the web?
    2. who is the operating system that you are using?

    If you use Microsoft Outlook client see this link for more information:
    Automatically change the colors of incoming message and fonts based on the sender, subject and beneficiaries
    I suggest you to give us more information, so that we can better help you.

    I hope this helps.
  • Change the font color on IE8 + XP

    I need to change the font color from blue to black on my computer XP WIN8 + that my wife is legaly blind and can't read light blue lettering

    Hi alkfmn,

    You will not be able to change the color of the font in internet explore.

    See the Microsoft article below to change the fonts or font on various components of Windows.

    How to change the appearance of items on the desktop in Windows XP

    http://support.Microsoft.com/kb/310543

    Customize your system with Windows XP

    http://www.Microsoft.com/windowsxp/using/Setup/personalize/default.mspx

    How to set accessibility features for people who are blind or who have low vision in Windows XP

    http://support.Microsoft.com/kb/308978

    How to control accessibility features for visually impaired users by using Utility Manager in Windows

    http://support.Microsoft.com/kb/307773

    I hope this helps!

    Halima S - Microsoft technical support.

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

Maybe you are looking for

  • Satellite A100 compatible with DDR 667 memory?

    HelloI have a question about the compatibility of memory, it seems that the Toshiba Satellite A100 series has the new motherboard (945 PM). The site intel, he says that this motherboard supports DDR 667. Although if you look closely at the specificat

  • Laptop HP 15-r033tx: start time

    I have the HP 15-r033tx laptop it takes 1-2 minute during start-up every time. It shows to the course to watch from 'office preparation' etc. I want to know that take time to start is ok or not, that I also use windows desktop 8 Hp and it takes 15 se

  • Synthetesis of frequencies with filtered signals (Convolution)

    Hello I am a new user of DIAdem and I analysis of the signal. To deal with my purchases, I use several tools alreaydy implement in DIAdem. But I want to do a convolution of the signal number to make a spectrum of synthesis. In fact, I want to filter

  • Help 2 is not included with VS2010

    I'm trying to get the documentation of the API for Measurement Studio for .NET, but the link to "Help NOR-DAQmx .NET Framework 3.5" is broken. He's looking for dexplore.exe and never find I guess VS2010 uses a completely different help system. I trie

  • Microsoft/Search Enhancement Pack folder opens at startup

    For a while when my computer starts a window pops up that contains a folder named "Microsoft", which in turn contains a folder named 'Search Enhancement Pack', the two files in date 25/12/2010. The files are in my computer/HP_Pavilion C: / Program Fi