Search for a string in Data Merge, then change the font color

I'm working on a postcard-style invitation with the addresses on the back. So far, I've finished the invitation and the mail-side template with a Data Merge to a CSV file successfully. Now, as part of my design, I want all of the letter "b"s on the mail-side template (Data Merge) to be yellow. Using JavaScript is this possilbe? This is 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;

Hi,
After setting preferences you need to call changeText() method, like
myDoc.changeText();
or
myStory.changeText();
But this is a static solution.
You could use a dinamic solution by define a proper characterStyle and take advantage of nestedGrepStyle in style applied to this part of your design.
So each character "b" could be applied with your characterStyle automatically, no need to run a script.
Jarek

Similar Messages

  • How do I change the font color for numbering in a matching question slide?

    I have a grey image on a question slide, but the numbering for the answers in a matching question is defaulting to grey so learners can't see to match up.  How can I change the font color of these choices?  Thanks.

    You probably edited the master slide without changing the theme colors? Check the Object Style for Answers in the Object Style Manager. The numbering takes the same color as the answer text.
    All depends on the Theme colors palette that you are using. Normally Question answers use the darkest tint of the fourth color. I started blogging about color management, but description of the use of Theme colors will be published later.
    Colorful 2015 with Adobe Captivate - Captivate blog

  • Changing the font color for the complete row based on the Keyfigure Values

    Hi Experts,
    Can any one help me to find a solution for this?.
    I have a requirement, in which the Font color for the complete Row needs to be set to RED in Bex Report, when the corresponding Row Keyfigure is more than a particular value.
    Ex: Notification-Material-Customer-Def Qty-delivered Qty
          1000000 - XXXXX- AAAAAA-10-1000
    in the above example, when the Defect qty increses more than 10, then the complete Row Including the characterstics, Notification, Material, and customer Should be Highlighted in Red. This has to happen automatically once the Query is refreshed.
    Please let me know if you have any suggestion here?.
    Regard,
    Muruganand.K

    Hi,
    Step 1: Click the Format Menu in Excel(BEX Analyzer)
    Step 2: Click the Style submenu
    Step 3: there will be number of SAPBEX formats available. Each of these relates to another cell of BEx (Header, Cell Data,
                Result  Row, Hierarchies, etc.). Also, they depend on data types.
    Step 4: Select SAPBEXchatext
    Step 5: Click Modify. This displays all the standard formatting option as shown below.
    Step 6: Select Font, Color (Background/ Font).
    Step 7: Click OK on both the screens. The entire BEx output result row Font and color is modified.
    Hope it helps........
    Regards,
    Suman

  • How do I change the font color for track changes in pages?

    I am using the "track changes" function to edit a document in pages, and would like to change the edited text from pale yellow green to a color I can actually see.  How do I do this?

    Hello Zoolie,
    That is an easy thing to do. Go to the drop down menu View > Comments and Changes > Author Color and then just select the color that you want and you will be good to go. Take a look at the article below for more information if needed. 
    Pages for Mac 5.0: Add comments and highlight text
    https://support.apple.com/kb/PH15379
    Regards,
    -Norm G. 

  • Is there a way to change the font color for emailing and the signature?

    Is there a way to change the font color with email signature on the iPhone and iPad?
    I changed the color in Word on my laptop, emailed and copied to my signature, but it converts it back to black........

    Looks like you didn't get a reply on your post, but it is still a problem.  Font size is supposedly changeable via "Accessibility" in Settings, but it doesn't work.  You can turn on "Zoom".

  • How can change the font in the script output and the data grid ?

    How can change the font in the script output and the data grid in Sql Developer?

    You can't easily unless you have the latest version (2.1.1).
    If you do have this version then changing the font in the Tools/Preferences menu under the code editor/fonts section will also change the font of the data grid.
    For details of changing the fonts in an earlier version then see Sue's post below.
    http://sueharper.blogspot.com/2010/03/back-to-basics-changing-font-setting-in.html

  • How do you set the font color for a specific entire row inside a JTable?

    How do you set the font color for a specific entire row inside a JTable?
    I want to change the font color for only a couple of rows inside a JTable.
    I've seen some ways to possibly do this with an individual cell.
    Clarification on changing the font color in an individual cell would be helpful too if
    there is no easy way to do this for a row.

    hai,
    Try out with this piece of code.Create your table and assign the renderer to each column in the table.
    CellColorRenderer m_CellColorRenderer = new CellColorRenderer();
    for(int i=0;i<your_JTable.getColumnCount();i++)
    your_JTable.getColumnModel().getColumn(i).setCellRenderer(m_CellColorRenderer);
    class CellColorRenderer extends JLabel implements TableCellRenderer
    CellColorRenderer()     
    setOpaque(true);     
    setHorizontalAlignment(LEFT);
    setVerticalAlignment(CENTER);
    setBackground(Color.white);
    setForeground(Color.black);
    protected void setValue(Object value)
         setText((value == null) ? "" : value.toString());
    public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected, boolean hasFocus, int row,int column)
         if(isSelected == true)
              setForeground(Color.red);
         else
              setForeground(Color.black);
         setValue(value);
         return this;
    regards,
    bala

  • Search for a String in a list of files

    Could anyone please send me a java sample code which searches for a string from a list of files and returns me the filename and the line in which the Search String was found ?
    Thanks in advance
    RR

    Simple solution would be -
    1. Traverse a directory for each file.
    2. Read each file using Buffered Reader.
    3. Use readLine() method to read a line.
    4. Use String.indexOf to see if the data which you are looking for is there in the line or not.
    5. If its there then store the line number and file name.
    6. When the loop will end you will have list of file name and line number where the data which you are looking for is present.

  • Accounting for varying values in Data merging

    Hi everyone,
    I've been asked to create a template for a degree certificate. So far I've created an InDesign document and used data merge to import the data from a .csv file. I've also used GREP styles to resize the name of the degree when it's longer than a certain number of characters. So far so good.
    My question has to do with how to account for different categories of certificates. Let me explain. In my spreadsheet I have thre types of certificates A, B, and C. Each category triggers two specific bits of text. So for example:
    When Cat = A
    the following blurb appears at the top of the certificate:
    WHEREAS THE UNIVERSITY OF NOWHERE HAS BEEN EMPOWERED BY ACTS OF THE LEGISLATURE OF MARS TO CONFER DEGREES AND AWARD DIPLOMAS OF THE UNIVERSITY
    and the following text appears just before the name of the degree:
    HAS BEEN ADMITTED BY THE UNIVERSITY TO THE DEGREE OF
    When Cat = B
    the following blurb appears at the top of the certificate:
    WHEREAS THE UNIVERSITY OF NOWHERE HAS BEEN EMPOWERED BY ACTS OF THE LEGISLATURE OF MARS TO CONFER DEGREES AND AWARD DIPLOMAS OF THE UNIVERSITY
    and the following text appears just before the name of the degree:
    HAS BEEN AWARDED THE
    When Cat = C
    there is no blurb at the top of the certificate.
    but the following text appears just before the name of the degree:
    HAS BEEN AWARDED THE
    I first thought of creating IF formulas in Excel but it doesn't work because I don't want the result to appear in the data, I want it to only appear once merged in the InDesign template.
    SO THE QUESTION IS:
    Is there any way to specify IF THEN values directly in the InDesign document? If not, does anyone have any idea if what I'm being asked to do here is even possible?
    Any help or nudge in the right direction would be greatly appreciated,
    Chris

    Hi Christine,
    I'll need to work through the example, but it would be that the blurbs are on thier own separate layers of page 1. And the data fields are simply on their own layer, still on that page.
    That's as far as I got in a quick perusal of his example. I plan on recreating the example tonight when I have a bit of my own time to spend. I suspect it will be a lot more clear following the example, bit for bit. If it does work out as it seems it should, I can think of a. coupon job I merged that would have (maybe) been easier than the 5 merge files I ended up with.
    I do want to mention, pointing back to my earlier comments, if there is anyway you can work with the IT people to produce a clean file ready for you, I would do so. Colin mentioned XML, and that is what I would strive for in this situation. But XML is a bit like being thrown into the deep end of the pool and learning to swim at the same time.

  • Searching for pictures by both date and keyword

    When I have the calendar tab up and a date with pictures is highlighted, when I go to select a keyword the calendar goes away and then I am back to my library. How do I search for pictures by both date and keyword?
    Thank You, Margaret

    Margaret:
    You can use a Smart Album to do the job. Just use the criteria:
    Keyword is "xxxx" and Date is "dd/mm/yyyy"
    Be sure to select All in the Match menu.
    Or you can use the text find box at the bottom in this undocumented way:
    1 - click on the library icon and in the text box type any character.
    2 - select the library icon again and type Command-I
    3 - in the Find window (the same as what you get for a Smart Album) set your criteria: Keyword is "xxx" and Date is "dd/mm/yyyy" and set "All" as the Match criteria.
    4 - hit the search button and those pictures will show up in the thumbnail window.
    5 - when complete clear the text box at the bottom of the window to get all of the photos back.
    Either way you'll get those photos with the keyword and particular date.

  • Search for a String within a document (Word, txt, doc) using JSP, JAVA

    Hi
    I have created a little application that uses combination of JSP and HTML. Users of this application can upload documents which are then stored on the server. I need to develop functionality where I can allows users to search for a string within a document. More precisely, user would type in some string in a text box and application will search all uploaded documents for that string and return the downloadable links to those documents that contains that string. I have never done this before. I was wondering if someone could get me started on this or point me to some thread where this idea is already discussed. Any Jave code exists for searching through documents??
    Thanks for your help
    Riz

    http://www.ibm.com/developerworks/java/library/j-text-searching.html
    http://en.wikipedia.org/wiki/Full_text_search
    Type these parameter in yahoo:+efficient text search
    you will need something like openoffice library to read microsoft word document.

  • Search for a string in SAP Script

    Hello Experts,
    Is there a way to search for a string in all Z SAP scripts, like ABAP source scan?
    Regards,
    Hari.

    Try using function module "READ_FORM" (you will have to write a simple z-program to find all SAPscripts in your system then use this function module to search the SAPScript Forms for a particular string).
    All you have to do is supply the "FORM" name and it will return all of the Pages, Paragraphs, and Texts etc....
    More specifically, try looping at the "FORM_LINES" internal table result and you will see the SAPScript text there....
    Have fun    !
    Edited by: Christopher Twirbutt on Sep 16, 2009 12:43 AM

  • How can I search for a string like a partial IP address in the global search

    When searching for a string like "10.255." the global search finds messages containing "255" or "10" and both.
    This happens no matter whether quotation is used or not.
    When quotation is used it probably will match on the given order as well, but beeing in the timezone '+0100' the string "10" is always found first (in the email headers...).
    Is there a way to tell the global search not to use '.' or any other character as whitespace?

    When searching for a string like "10.255." the global search finds messages containing "255" or "10" and both.
    This happens no matter whether quotation is used or not.
    When quotation is used it probably will match on the given order as well, but beeing in the timezone '+0100' the string "10" is always found first (in the email headers...).
    Is there a way to tell the global search not to use '.' or any other character as whitespace?

  • How do i search for a string in a txt file using java??

    How do i search for a string in a txt file using java??
    could you please help thanks
    J

    Regular expressinos work just fine, especially when
    searching for patterns. But they seem to be impying
    it's a specific group of characters they're looking
    for, and indexOf() is much faster than a regex.If he's reading from a file, the I/O time will likely swamp any performance hit that regex introduces. I think contains() (or indexOf() if he's not on 5.0 yet) is preferable to regex just because it's simpler. (And in the case of contains(), the name makes for a very clear, direct mapping between your intent and the code that realizes it.)

  • How to search for a string in ALL Function Modules source code

    Hello,
    I want to search for the string "HELLO" in all FUNCTION MODULES source code(FM, no reports/programs).
    Is this possible? How?
    Cheers,
    Andy

    hi,
    Execute RPR_ABAP_SOURCE_SCAN to search for a string in the code ... Press where-used-list button on the program which takes to the function group or the function module where it is used ..
    Regards,
    Santosh

Maybe you are looking for

  • Purchase Order from Requisition

    My scenario is:     I need to create a Purcahase Order based on Purchase Requisition as i need to add one new line item as a sample in the line item.If anybody has worked on the similar kind of scenario...kindly help me. This is related to transactio

  • JTextArea Formatting Questions

    How can I add a Scroll Bar to the JTextArea in the following code, I have tried adding it, as one can see below, however no matter what I seem to change, the scroll bar does not appear. If anyone could help me I'd grealtly appreciate it. public class

  • Allocating costs to service orders

    Hi All, I have a scenario I'm hoping one of you may be able to help me with. Currently when an external service technician carries out work at a customers site the costs related to that work are booked to a single service order. This work however may

  • Services button not working

    Hi, im trying to use the extension mobility feature. We have it setup and working. I currently use an account that works perfectly. However, the "services" button on our phones, only seem to work on some. I've compared the device configurations on a

  • Outputting a specific level of Content Parent

    I've taken a look at the Developer Guide and the Javadoc Reference but couldn't find an answer to my question. Is there a way to either: - Read Content Parent assets, but at a specific level (depth) only, in order to output them (e.g. in an HTML opti