4 Replies Latest reply on Mar 10, 2014 4:29 PM by brogers7

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

    brogers7

      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;