Text find and Highlight

I have a textbox that I am loading text from instructionsArray that gets data from a XML file.  I want to search that textbox for a word that might be in the dictionaryArray that gets data from and XML file. Then I want the word if its there to be higlighted in red and be able to rollover  or click the word to get a popup that shows the words definition that is also in the dictionaryArray.    SO the code for all of this as I have it so far builds a rectangle backgournd and addes the textbox to it. The MA is a variable that tells what set of instuctions it is on (1, 2, etc).  Everything works except the search and highlight. Is this better?
XML FILE
CODE for XML Dictionary
<?xml version="1.0" encoding="utf-8"?>
<dictionary>
          <allWords>
                    <word>Enzymes</word>
                    <definition>Natural chemical substances found in all plant and animal tissue. In growing plants, they aid in all growth processes including maturation and ripening. After maturity, continued activity of enzymes can cause undesirable changes in color, flavor and texture. Enzymes that cause these undesirable changes are destroyed during heat processing of foods.</definition>
                    <visualAids>
                              <image src="Flash_pictures/tn/tn_mouth.png" title="Mouth" url="Flash_pictures/mouth.png" />
                    </visualAids>
          </allWords>
          <allWords>
                    <word>Oxidation</word>
                    <definition>Gain in oxygen or loss of electrons. Acid Foods: Foods containing natural acids, those that had vinegar added to them or those produced by controlled microbial fermentation are classified as acid foods. This food group includes fruits, tomatoes, pickles, sauerkraut and relishes. Because microorganisms do not thrive in acid, these foods can be safely processed in a water bath canner at 212 F (100 C) </definition>
                    <visualAids>
                              <image src="Flash_pictures/tn/tn_mouth.png" title="Mouth" url="Flash_pictures/mouth.png" />
                    </visualAids>
          </allWords>
</dictionary>
CODE FOR XML INSTRUCTIONS
<?xml version="1.0" encoding="utf-8"?>
<allInsturctions>
          <actInstructions>
                    <name>
                              act1
                    </name>
                    <boxtext>
                              Before tomatoes enter the plant, they must be graded for quality. The quality of the tomatoes on a truckload determines how much the producer gets paid. Only grade A/B tomatoes will be used in canning. Grade C tomatoes may be used for other types of tomato food products such as juice or salsa.
                    </boxtext>
                    <instructions>
                              <![CDATA[ Tomato Grading
<p>Enzymes The quality grade of a tomato is based on 3 things: size, ripeness and defects. This step is only an average of the quality for the whole truck so the producer can be fairly paid. Later, every tomato will be graded both by machine and by hand before being processed.
<p>Minimum quality requirements must be met to continue processing or you risk the final canned product getting recalled by the USDA. The estimated Grade quality for the truck is not sufficient enough. Each tomato is graded for redness by a machine where tomatoes that are too green are siphoned off for juice production. Tomatoes are also evaluated by hand so that any broken fruit can be discarded. Broken fruit will jam up the machinery and not peel properly.</p>
<p> Now it is your turn to practice grading tomatoes in order to determine how much to pay the producer!
1.          Take a sample of tomatoes from 3 different spots in the truckload. <br/>2.          Give each separate sample a grade of A/B, or C. <br/>3.          Then average the 3 samples together to determine how much to pay you producer and decide what finished product to use the tomatoes for.
</p>
]]>
                    </instructions>
                    <question>
                              <![CDATA[<br/> <br/> <br/> How would you grade this truck?</p>]]>
                    </question>
                    <options>
                              <a>Grade A</a>
                              <b>Grade B</b>
                              <c>Grade C</c>
                    </options>
                    <image src="Flash_pictures/tn/tn_mouth.png" title="Mouth" url="Flash_pictures/mouth.png" />
                    <video>
                              Arrival
                    </video>
          </actInstructions>
</allInsturctions>
//LOAD EXTERNAL XML FILES
function loadXML():void
          XMLLoader.addEventListener(Event.COMPLETE, xmlLoadComplete);
          XMLDataRequest = new URLRequest(XMLFiles[XMLFilesPointer]);
          XMLLoader.load(XMLDataRequest);
          trace(XMLFiles[XMLFilesPointer]);
function xmlLoadComplete(e:Event):void
          XMLLoader.removeEventListener(Event.COMPLETE, xmlLoadComplete);
          var xmlData = XML(e.target.data);
          //distinguish between both xml types
          xmlData.ignoreWhitespace = true;
          if (xmlData.actInstructions != undefined)
          {//if instructions node exists, then it is instructions xml
                    trace('instructions xml file');
                    for (var b = 0; b < xmlData.actInstructions.length(); b++)
                              instructionsArray.push({name:xmlData.actInstructions[b].name.text(), boxtext:xmlData.actInstructions[b].boxtext.text(), instructions: xmlData.actInstructions[b].instructions.text(), question: xmlData.actInstructions[b].question.text(), image: xmlData.actInstructions[b].visualAids.text(), video: xmlData.actInstructions[b].video.text() });
          if (xmlData.allWords != undefined)
          {//if movie node exists, then it is dictionary xml
                    trace('dictionary xml file');
                    trace(xmlData.allWords.length());
                    for (var n = 0; n < xmlData.allWords.length(); n++)
                              dictionaryArray.push({word: xmlData.allWords[n].word.text(), definition: xmlData.allWords[n].definition.text(), image: xmlData.allWords[n].visualAids.text() });
          XMLFilesPointer++;
          if (XMLFilesPointer < XMLFiles.length)
                    loadXML();
//build display and add text
var words:Array = instructionsArray[MA].instructions.split(/\s+/);
var highlight:TextFormat = new TextFormat("Arial",14,0xff0000,null,true);
var dictionaryTimer:Timer = new Timer(100,dictionaryArray.length-1);
dictionaryTimer.addEventListener(TimerEvent.TIMER, onTimer);
dictionaryTimer.start();
function onTimer(e:TimerEvent):void
          textbox.setTextFormat(textbox.defaultTextFormat);
          var re:RegExp = new RegExp("\\b"+words[dictionaryTimer.currentCount]+"\\b", "gi");
          var result:Object = re.exec(instructionsArray[MA].instructions);
          while (result)
                    textbox.setTextFormat(highlight, result.index, result.index+words[dictionaryTimer.currentCount].length);
                    result = re.exec(instructionsArray[MA].instructions);
instructionsFormat.font = tomatoBasefont.fontName;
                              instructionsFormat.size = 14;
                              textbox.defaultTextFormat = instructionsFormat;
                              textbox.multiline = true;
                              textbox.htmlText = instructionsArray[MA].instructions;
                              textbox.width = 778;
                              textbox.height = 340;
                              //Testing Dictionary Search START
                              //Search instructions for words in dictionaryArray
                              dictionaryTimer.addEventListener(TimerEvent.TIMER, onTimer);
                              dictionaryTimer.start();
                              //Testing Dictionary Search END
                              i_MC.x = 180;
                              i_MC.y = 160;
                              i_MC.name = "instructionBox";
                              // Shadow Gray color;
                              qbkg_shadow.graphics.beginFill(shadowColor);
                              // x, y, width, height, ellipseW, ellipseH;
                              qbkg_shadow.graphics.drawRoundRect(10, 10, 788, 351, 20, 20);
                              qbkg_shadow.graphics.endFill();
                              // Purple Box color;
                              qbkg.graphics.beginFill(boxColor);
                              // x, y, width, height, ellipseW, ellipseH;
                              qbkg.graphics.drawRoundRect(0, 0, 788, 351, 20, 20);
                              qbkg.graphics.endFill();
                              xClose.addEventListener(MouseEvent.MOUSE_DOWN, mouseClickHandler);
                              xClose.x = 750;
                              xClose.y = 2;
                              i_MC.addChild(qbkg_shadow);
                              i_MC.addChild(qbkg);
                              i_MC.addChild(textbox);
                              i_MC.addChild(xClose);
                              addChild(i_MC);

And here is a "workable solution" - an example of how to deal with it.
This class creates roll overs and tooltips for the search term.
A lot of this code is based on what we discussed before - nothing really new.
Just place this class in to FLA directory and make this class a Document Class in Flash IDE. I don't like Flash IDE and coding on the timeline - so it is up to you to translate it into  timeline code. Some aspects are commented in the code.
package
          import flash.display.Sprite;
          import flash.events.MouseEvent;
          import flash.geom.Rectangle;
          import flash.text.TextField;
          import flash.text.TextFormat;
          public class TextRollOverExample extends Sprite
                    private var highlight:TextFormat = new TextFormat("Arial", 14, 0xff0000, null, true, true);
                    private var originalText:String;
                    private var tf:TextField;
                    private var inputField:TextField;
                    private var termBoundaries:Vector.<Rectangle>;
                    private var _searchTerm:String;
                    private var tipText:TextField;
                    public function TextRollOverExample()
                              init();
                    private function init():void
                              originalText = "I have a textfield that I am reading the content in from a XML file.  Is there a way to search said textfield for a certain word from an Array?  For Ex.  if I have a paragraph of text in the textfield and I want to search the textfield for a word that is in an array like 'The' and underline every instance of the word can I do that?";
                              tf = new TextField();
                              tf.defaultTextFormat = new TextFormat("Arial", 12);
                              tf.multiline = tf.wordWrap = true;
                              tf.width = 300;
                              tf.autoSize = "left";
                              tf.text = originalText;
                              tf.x = tf.y = 50;
                              addChild(tf);
                              searchTerm = "textfield";
                    private function set searchTerm(term:String):void
                              _searchTerm = term;
                              tf.setTextFormat(tf.defaultTextFormat);
                              var re:RegExp = new RegExp(term, "gi");
                              var result:Object = re.exec(originalText);
                              termBoundaries = new Vector.<Rectangle>();
                              while (result)
                                        tf.setTextFormat(highlight, result.index, result.index + term.length);
                                        // get term boundaries and push them into collection of all related boundaries
                                        termBoundaries.push(tf.getCharBoundaries(result.index).union(tf.getCharBoundaries(result.index + term.length)));
                                        result = re.exec(originalText);
                              drawHotSpots();
                    private function drawHotSpots():void
                              // create hot spots for all
                              for each (var rect:Rectangle in termBoundaries)
                                        hotSpot = rect;
                    private function set hotSpot(rect:Rectangle):void
                              var s:Sprite = new Sprite();
                              s.buttonMode = s.useHandCursor = true;
                              s.addEventListener(MouseEvent.MOUSE_OVER, onHotSpotInteraction);
                              s.addEventListener(MouseEvent.MOUSE_OUT, onHotSpotInteraction);
                              s.graphics.beginFill(0xff0000, 0);
                              s.graphics.drawRect(0, 0, rect.width, rect.height);
                              addChild(s);
                              // position hotspot over corresponding word
                              s.x = tf.x + rect.x;
                              s.y = tf.y + rect.y;
                    private function onHotSpotInteraction(e:MouseEvent):void
                              switch (e.type)
                                        case MouseEvent.MOUSE_OVER:
                                                  drawTooltip(_searchTerm, Sprite(e.currentTarget));
                                                  break;
                                        case MouseEvent.MOUSE_OUT:
                                                  killToolTip();
                                                  break;
                    private function drawTooltip(term:String, target:Sprite):void
                              killToolTip();
                              tipText = new TextField();
                              tipText.defaultTextFormat = new TextFormat("Arial", 11, 0x008000);
                              tipText.width = 100;
                              tipText.border = true;
                              tipText.background = true;
                              tipText.borderColor = 0x808080;
                              tipText.autoSize = "left";
                              tipText.multiline = tipText.wordWrap = true;
                              tipText.text = "This thingy describes what " + term + " is.";
                              addChild(tipText);
                              tipText.x = target.x;
                              tipText.y = target.y + target.height + 2;
                    private function killToolTip():void
                              if (tipText)
                                        if (this.contains(tipText))
                                                  removeChild(tipText);
                                        tipText = null;

Similar Messages

  • Indesign CC doesn't find and highlight links when trying to relink!!

    I was so excited to see all the customizable options in my new InDesign CC, until I tried to relink a file from the links palette and CC doesn't find and highlight the file anymore like it used to do with 4 and 5!!
    As a prepress operator dealing with hundreds of clients and manipulating files all day long, this feature was a great blessing.
    Hope it's just a glitch and somebody is fixing it or I'll have to go back to 5

    I have been using InDesign 2, 3, 4, 5 and 5.5 with all OSX up to 10.6.8 and always had that feature. Some say the problem is Lion, some say is InDesign 6 and up. I'm back to 5.5 anyway because CC is way too slow with my old Mac G5.

  • Text find and change problem in CS3 and CS4 script

    I use the script below to find some text and change into others.
    There is one thing the script can't do it for me.
    Example:
    (g) Management
    (1) that no law which is enacted in the Cayman Islands imposing any tax to be levied on profits, income, gains or appreciation shall apply to the Company or its operations; and
    (2) that the aforesaid tax or any tax in the nature of estate duty or inheritance tax shall not be payable on or in respect of the shares, debentures or other obligations of the Company.
    Example:(END)
    I got a lot of topics or points in the passage. And I want to change the space between '(g)' and 'Management' into a tab character. So I revised the plain text file 1text.
    PS: 1text.txt is filled with what to change.
    text {findWhat:"^p(^?) "} {changeTo:"^p(^?)^t"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all space-dash-space and replace with an en dash.
    The result is:
    (^?)^tManagement
    (^?)^tthat no law which is enacted in the Cayman Islands imposing any tax to be levied on profits, income, gains or appreciation shall apply to the Company or its operations; and
    (^?)^tthat the aforesaid tax or any tax in the nature of estate duty or inheritance tax shall not be payable on or in respect of the shares, debentures or other obligations of the Company.
    PS: ^t is a tab character.
    result (END)
    This is not what I want.
    It should be '(g)^tManagement'.
    PS: ^t is a tab character.
    Please someboady help me out to revised the script below to change the text into what I want. Thanks so much.
    Here is the script.
    //FindChangeByList.jsx
    //An InDesign CS4 JavaScript
    @@@BUILDINFO@@@ "FindChangeByList.jsx" 2.0.0.0 10-January-2008
    //Loads a series of tab-delimited strings from a text file, then performs a series
    //of find/change operations based on the strings read from the file.
    //The data file is tab-delimited, with carriage returns separating records.
    //The format of each record in the file is:
    //findType<tab>findProperties<tab>changeProperties<tab>findChangeOptions<tab>description
    //Where:
    //<tab> is a tab character
    //findType is "text", "grep", or "glyph" (this sets the type of find/change operation to use).
    //findProperties is a properties record (as text) of the find preferences.
    //changeProperties is a properties record (as text) of the change preferences.
    //findChangeOptions is a properties record (as text) of the find/change options.
    //description is a description of the find/change operation
    //Very simple example:
    //text {findWhat:"--"} {changeTo:"^_"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all double dashes and replace with an em dash.
    //More complex example:
    //text {findWhat:"^9^9.^9^9"} {appliedCharacterStyle:"price"} {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false} Find $10.00 to $99.99 and apply the character style "price".
    //All InDesign search metacharacters are allowed in the "findWhat" and "changeTo" properties for findTextPreferences and changeTextPreferences.
    //If you enter backslashes in the findWhat property of the findGrepPreferences object, they must be "escaped"
    //as shown in the example below:
    //{findWhat:"\\s+"}
    //For more on InDesign scripting, go to http://www.adobe.com/products/indesign/scripting/index.html
    //or visit the InDesign Scripting User to User forum at http://www.adobeforums.com
    main();
    function main(){
    var myObject;
    //Make certain that user interaction (display of dialogs, etc.) is turned on.
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
    if(app.documents.length > 0){
      if(app.selection.length > 0){
       switch(app.selection[0].constructor.name){
        case "InsertionPoint":
        case "Character":
        case "Word":
        case "TextStyleRange":
        case "Line":
        case "Paragraph":
        case "TextColumn":
        case "Text":
        case "Cell":
        case "Column":
        case "Row":
        case "Table":
         myDisplayDialog();
         break;
        default:
         //Something was selected, but it wasn't a text object, so search the document.
         myFindChangeByList(app.documents.item(0));
      else{
       //Nothing was selected, so simply search the document.
       myFindChangeByList(app.documents.item(0));
    else{
      alert("No documents are open. Please open a document and try again.");
    function myDisplayDialog(){
    var myObject;
    var myDialog = app.dialogs.add({name:"FindChangeByList"});
    with(myDialog.dialogColumns.add()){
      with(dialogRows.add()){
       with(dialogColumns.add()){
        staticTexts.add({staticLabel:"Search Range:"});
       var myRangeButtons = radiobuttonGroups.add();
       with(myRangeButtons){
        radiobuttonControls.add({staticLabel:"Document", checkedState:true});
        radiobuttonControls.add({staticLabel:"Selected Story"});
        if(app.selection[0].contents != ""){
         radiobuttonControls.add({staticLabel:"Selection", checkedState:true});
    var myResult = myDialog.show();
    if(myResult == true){
      switch(myRangeButtons.selectedButton){
       case 0:
        myObject = app.documents.item(0);
        break;
       case 1:
        myObject = app.selection[0].parentStory;
        break;
       case 2:
        myObject = app.selection[0];
        break;
      myDialog.destroy();
      myFindChangeByList(myObject);
    else{
      myDialog.destroy();
    function myFindChangeByList(myObject){
    var myScriptFileName, myFindChangeFile, myFindChangeFileName, myScriptFile, myResult;
    var myFindChangeArray, myFindPreferences, myChangePreferences, myFindLimit, myStory;
    var myStartCharacter, myEndCharacter;
    var myFindChangeFile = myFindFile("/FindChangeSupport/1test.txt")
    if(myFindChangeFile != null){
      myFindChangeFile = File(myFindChangeFile);
      var myResult = myFindChangeFile.open("r", undefined, undefined);
      if(myResult == true){
       //Loop through the find/change operations.
       do{
        myLine = myFindChangeFile.readln();
        //Ignore comment lines and blank lines.
        if((myLine.substring(0,4)=="text")||(myLine.substring(0,4)=="grep")||(myLine.substring(0, 5)=="glyph")){
         myFindChangeArray = myLine.split("\t");
         //The first field in the line is the findType string.
         myFindType = myFindChangeArray[0];
         //The second field in the line is the FindPreferences string.
         myFindPreferences = myFindChangeArray[1];
         //The second field in the line is the ChangePreferences string.
         myChangePreferences = myFindChangeArray[2];
         //The fourth field is the range--used only by text find/change.
         myFindChangeOptions = myFindChangeArray[3];
         switch(myFindType){
          case "text":
           myFindText(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
           break;
          case "grep":
           myFindGrep(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
           break;
          case "glyph":
           myFindGlyph(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
           break;
       } while(myFindChangeFile.eof == false);
       myFindChangeFile.close();
    function myFindText(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
    //Reset the find/change preferences before each search.
    app.changeTextPreferences = NothingEnum.nothing;
    app.findTextPreferences = NothingEnum.nothing;
    var myString = "app.findTextPreferences.properties = "+ myFindPreferences + ";";
    myString += "app.changeTextPreferences.properties = " + myChangePreferences + ";";
    myString += "app.findChangeTextOptions.properties = " + myFindChangeOptions + ";";
    app.doScript(myString, ScriptLanguage.javascript);
    myFoundItems = myObject.changeText();
    //Reset the find/change preferences after each search.
    app.changeTextPreferences = NothingEnum.nothing;
    app.findTextPreferences = NothingEnum.nothing;
    function myFindGrep(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
    //Reset the find/change grep preferences before each search.
    app.changeGrepPreferences = NothingEnum.nothing;
    app.findGrepPreferences = NothingEnum.nothing;
    var myString = "app.findGrepPreferences.properties = "+ myFindPreferences + ";";
    myString += "app.changeGrepPreferences.properties = " + myChangePreferences + ";";
    myString += "app.findChangeGrepOptions.properties = " + myFindChangeOptions + ";";
    app.doScript(myString, ScriptLanguage.javascript);
    var myFoundItems = myObject.changeGrep();
    //Reset the find/change grep preferences after each search.
    app.changeGrepPreferences = NothingEnum.nothing;
    app.findGrepPreferences = NothingEnum.nothing;
    function myFindGlyph(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
    //Reset the find/change glyph preferences before each search.
    app.changeGlyphPreferences = NothingEnum.nothing;
    app.findGlyphPreferences = NothingEnum.nothing;
    var myString = "app.findGlyphPreferences.properties = "+ myFindPreferences + ";";
    myString += "app.changeGlyphPreferences.properties = " + myChangePreferences + ";";
    myString += "app.findChangeGlyphOptions.properties = " + myFindChangeOptions + ";";
    app.doScript(myString, ScriptLanguage.javascript);
    var myFoundItems = myObject.changeGlyph();
    //Reset the find/change glyph preferences after each search.
    app.changeGlyphPreferences = NothingEnum.nothing;
    app.findGlyphPreferences = NothingEnum.nothing;
    function myFindFile(myFilePath){
    var myScriptFile = myGetScriptPath();
    var myScriptFile = File(myScriptFile);
    var myScriptFolder = myScriptFile.path;
    myFilePath = myScriptFolder + myFilePath;
    if(File(myFilePath).exists == false){
      //Display a dialog.
      myFilePath = File.openDialog("Choose the file containing your find/change list");
    return myFilePath;
    function myGetScriptPath(){
    try{
      myFile = app.activeScript;
    catch(myError){
      myFile = myError.fileName;
    return myFile;

    It takes me a lof of time to comprehend the sentence you write. Cause I am a Chinese. My poor English.
    I have to say "you are genius". I used to use the indesign CS2. There is no GREP function in CS2. When I get the new script, I do not know how to use it. Just when I saw the
    'grep {findWhat:"  +"} {changeTo:" "} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all double spaces and replace with single spaces.'
    Being confused.
    Thanks so much. It seems I have to relearn the advanced Indesign.

  • Find and Highlight Mulitple Words in Acrobat Pro 9

    After finding a word how can you then highlight all of them?.

    I've developed a tool that does just that. Have a look here:
    http://try67.blogspot.com/2008/11/acrobat-highlight-all-instances-of.html

  • Using automator to edit text - find and replace

    Hello. I have a huge database of tv repair tips. Unfortunately, when i started to accumulate the tips I put them in an html table like this:
    <tr>
    <td class="NoiseDataTD">TELEVISION </td>
    <td class="NoiseDataTD">SONY </td>
    <td class="NoiseDataTD">36XBR400 </td>
    <td class="NoiseDataTD">DEAD - NO H.V. - INTERMITTENT START UP - 'D Board' NG. </td>
    <td class="NoiseDataTD">IC6501, MCZ3001D 0r MCZ3001DB(8-759-670-30) - >>>HARD TO REPLACE!---tip:CUT PINS FROM TOP THEN PULL OUT SLOWLY </td>
    </tr>
    <tr>
    <td class="NoiseDataTD">TELEVISION </td>
    <td class="NoiseDataTD">SONY </td>
    <td class="NoiseDataTD">63A </td>
    <td class="NoiseDataTD">INSUFFICIENT HEIGHT </td>
    <td class="NoiseDataTD">CHECK C522 REPLACE IF PARTIALLY OR COMPLETELY OPEN </td>
    </tr>
    <tr>
    <td class="NoiseDataTD">TELEVISION </td>
    <td class="NoiseDataTD">SONY </td>
    <td class="NoiseDataTD">AA-2 </td>
    <td class="NoiseDataTD">Int. loss of pix (HV) after 10 Min. Audio Normal.Pwr up again & OK for 10Min </td>
    <td class="NoiseDataTD">H Protect Circuit. D521 (7.5 zener) ECG5015 </td>
    </tr>
    <tr>
    <td class="NoiseDataTD">TELEVISION </td>
    <td class="NoiseDataTD">SONY </td>
    <td class="NoiseDataTD">AA-2D </td>
    <td class="NoiseDataTD">VERTICAL HEIGHT PROBLEM </td>
    <td class="NoiseDataTD">BAD YOKE: BAD YOKE WINDINGS MEASURED 6 OHMS, SHOULD BE CLOSE TO 9 OHMS </td>
    </tr>
    <tr>
    <td class="NoiseDataTD">TELEVISION </td>
    <td class="NoiseDataTD">SONY </td>
    <td class="NoiseDataTD">AA-2W </td>
    <td class="NoiseDataTD">Negative main pix, pip video ok. Customer heard pop then pix went dark. </td>
    <td class="NoiseDataTD">IC355. CSA2131S </td>
    </tr>
    Now, I want to input the tips into a MySQL database with an insert statement like:
    INSERT INTO `otips` (`id`, `brand`, `model`, `problem`, `solution`, `user`, `date`) VALUES (NULL, UCASE('SONY'), UCASE('KP-53XBR200'), UCASE('CONVERGENCE OFF'), UCASE('REPLACED CONVERGENCE IC''S STK392-020 AND PICO FUSE PS5007 3.15 AMP open'), '0', '0000-00-00');
    I've been all over the help files and different websites with tutorials and I cannot figure out how to do this using automator. Could anyone tell me if this can be done with automator and perhaps point me in the right direction.
    Thanks,
    daniel
    IMac Intel Core Duo   Mac OS X (10.4.8)  

    Are you familliar with regular expressions? If you are, then you can create a shell script and incorporate it into your workflow. Or you could use bbedit or textwrangler from barebones.com to search and replace in multiple files.

  • Action that finds specified words and highlight the whole sentence or paragraph

    Hi All,
    I know a action file from Acrobat users group (http://acrobatusers.com/content/find-highlight-words-and-phrases) which find and highlight a set of words using Acrobat action. But, is this possible to modify the javascript to select and highlight the "whole sentence" of the word selected? I have no knowledge about javascript, but hope I can learn how to search a word and grab the sentence or even the paragraph that a selected word appears in!
    Thanks a lot for all your help.
    I copied the said javascript in below:
    / Highlight Color
    var colHilite = color.yellow;
    var oDoc = event.target;
    var aAnnts = oDoc.getAnnots({sortBy:"Author"});
    for(var i=0;i<aAnnts.length;i++)
       if(aAnnts[i].type == "Redact")
          aAnnts[i].type = "Highlight";
          aAnnts[i].strokeColor = colHilite;

    Thanks for your reply! But can I just extend the selection like a number of words or entire line of sentence before and after that search word for highlight/redaction? like Acrobat advanced search did some kind of result for finding but not wide enough I think.

  • Problem editing text color and page properties due to favicon link

    I recently added a link to a sites favicon using the link tag. Following advice on the net this was added beneath the HTML tag and before the HEAD tag. I was using a Dreamweaver template for the site and it updated all pages with the new link in the non-editable area above HEAD and just after the template declaration.
    This was fine, unitl the user went to edit the site. He found that he could no longer get to page properties as he got an error that no page properties existed in editable areas... although there was an editable region for the page title. Also text color and highlighting were now disabled.
    Moving the link tag into the head area has resolved the editing issue, but it seems a strange bug. Is there some way to add something between HTML and HEAD and have it appear before the InstanceBegin of the template?

    You can edit text in any PDF by using trial version but as for as my knowledge and limited experience with Adobe I could not find any text color option in Adobe Acrobat. But you can highlight text in Adobe Acrobat. If you want to change the text color in PDF, I would like to recommend some another software which allows you to change the color of text and is available for download here.
    Let me tell you how can change text color using this software. Open PDF file > go to "edit tab" > Click "edit" then highlight text to change the color. As you can see in the below screenshot.
    Free free to ask. Hope it helps you. Don't forget to come back to share your views.
    Thanks

  • Ability to paste text "content" and not formatting

    I'd like to be able to copy text and paste it over other text without pasting the formatting.
    E.g. I have 2 point text objects, both have different appearances.
    If I highlight the text from the first and paste it over the second, the appearance gets pasted as well.
    I'd like to be able to keep the second object's appearance intact.
    Hate to bring up Corel DRAW again, but Corel lets you do what I'm asking for.
    Seems to me if you want to copy some text and include its appearance then you'd just duplicate the whole object.
    But if I use the Text Tool and highlight the text and then copy, it does the same exact thing.
    Knowhattamean?

    I agree. This option is very often needed. On the base and they know that the other teams Adobe.
    I understand that sometimes it is better not to move the code small reasons, because this could in turn introduces big problems.
    Code was an old, complicated, and probably very few people knew of what they exactly consist.
    But now that he is re-written 64-bit such things should be immediately implemented.
    I need this to not think about Ilustartor as a separate, backward planet of Adobe.
    Regards for All!

  • Find feature Highlight Color and End of document alert

    I am using Version 2.0.7 and noticed two problems with the text find feature that I hope someone else knows about a configuration setting or work around that will resolve the problems.
    Thanks,
    Problem 1. Found search characters are highlighted in gray. This color is difficult to spot if not looking straight at the screen or if only a few characters are in the search. Is there a preference setting that can change the color of found text searches?
    Problem 2. When reaching the end of the email, there is no alert message to ask if the find function should search backwards. Clicking on the find Next button causes the process automatically loop back to the top and begin again.
    Is this a bug or the way the function works?

    Thank you for responding to my query.
    I performed the following additional analysis and confirmed the behaviors still exists. Please let me know these conditions can be duplicated.
    Problem 1 - highlight text color
    A. Checked preference settings as recommended and confirmed Highlight Color is "Gold".
    B. Opened mail message, selected Edit>Find and typed in the search characters.
    C. Clicked on the next button in the Find window.
    D. Results is that the found text highlight color was "Grey" in the email message. What would be expected is the found text color to be "Gold".
    Problem 2 - End of message foud text alert.
    I read the initial description and found that this problem was misstated. So I am offering the following script to illustrate it:
    A. In the find box select a word or combination of characters that does exist in the message.
    B. Click on find button.
    C. Listen for the audio alert advising there was no match.
    D. Change the Find Box selection to a word or group of characters that occcurs multiple times in the message.
    E. Click on the Next button in the Find text window.
    F. Note that the find process stops at each occurence of the search characters. (as stated in problem 1 the highlight color is "Grey')
    G. Keep on clicking the Find button. The result is that there is no end of message alert. Unlike the alert in step C, the find process automatically loops back to the first match and continues as long as the Next button is clicked. What would be expected is an end of search alert for both unfound and found conditions.
    Regards,
      Mac OS X (10.4.6)  

  • Use VBA and Excel to open Dreamweaver HTML (CS5), find and replace text, save and close

    I wish to use VBA and Excel to programmatically open numbered Dreamweaver HTML (CS5) and find and replace text in the code view of these files, save and close them.
    I have  5000 associations between Find: x0001 and Replace: y0001 in an Excel sheet.
    I have the VBA written but do not know how to open, close and save the code view of the ####.html files. Please ... and thank you...
    [email protected]

    This is actually the code view of file ####.html that I wish to find and replace programmatically where #### is a four digit number cataloguing each painting.... In 1995 I thought this was clever... maybe not so clever now :>)) Thank you for whatever you can do Rob!
    !####.jpg!
    h2. "Name####"
    Oils on acrylic foundation commercial canvas - . xx X xx (inches) Started
    Back of the Painting In Progress </p> </body> </html>
    Warmest regards,
    Phil the Forecaster, http://philtheforecaster.blogspot.ca/ and http://phils-market.blogspot.ca/

  • How do I find and replace text in PHP files?

    How can I in CS3 make sitewide changes to the text in PHP pages without changing variable names etc that have the same name?
    For example if I have an installation of a PHP forum and I want to change every instance of the word 'forum' to 'message board'...
    If I used the 'inside tag' search with " as the tag, then if "" contained a variable called 'forum' it would also be changed and therefore corrupt the code....
    Is there a simple way around this?
    Thanks!
    I'm using CS3 on Windows Vista.

    It looks like you're trying to find and replace source code, so you may be able to look at the various places that are looked at when finding and uncheck the ones that don't apply.
    But, if it's all source code then that won't help.  One thing that may work is to expand the search option - for example if the work "forum" that you're wanting to change it preceded by another word, or character or something that sets it apart, then do you find on that. You can expand that search phrase as far out in either direction that you need to to make it different, if of course that is practical in your situation.
    The only other way I can think of is to somehow create an exception rule, but I'm not sure if that's possible or how to do it.

  • Folder action to find and replace text and change line feeds

    I want to use a folder action to find and replace text and change Mac carriage returns to DOS line feeds inside text files.
    The text to be replaced is: "/Users/wim/Music/iTunes/iTunes Music/Music" (without the quotes)
    This text has to be removed (i.e. replaced by an empty string)
    The text occurs many times within each file.
    The files are playlists exported from iTunes in the M3U format (which are text files). They contain Mac carriage returns. These need to be changed to DOS line feeds.
    I have found the following two perl commands to achieve this:
    To find and replace text: perl -pi -w -e 's/THIS/THAT/g;' *.txt
    To change carriage returns to line feeds: perl -i -pe 's/\015/\015\012/g' mac-file
    I know that it's possible to make a folder action with Automator that executes a shell script.
    What I want to do is drop the exported playlists in M3U format in a folder so that the folder action will remove the right text and change the carriage returns.
    My questions are:
    Is it possible to make a folder action that executes command line commands instead of shell scripts?
    What is the correct syntax for the two commands when used in a folder action shell script? Especially, how do I escape the slashes (/) in the string to be removed?
    Thanks for your help

    Ok, I've include an applescript to run a shell command. The applesript command quoted form makes a string that will end up as a single string on the bash command line.  Depending on what you want to do, you may need multiple string on the bash command lines.  I've included some information on folder actions.
    It is easier to diagnose problems with debug information. I suggest adding log statements to your script to see what is going on.  Here is an example.
        Author: rccharles
        For testing, run in the Script Editor.
          1) Click on the Event Log tab to see the output from the log statement
          2) Click on Run
        For running shell commands see:
        http://developer.apple.com/mac/library/technotes/tn2002/tn2065.html
    on run
        -- Write a message into the event log.
        log "  --- Starting on " & ((current date) as string) & " --- "
        --  debug lines
        set desktopPath to (path to desktop) as string
        log "desktopPath = " & desktopPath
        set unixDesktopPath to POSIX path of desktopPath
        log "unixDesktopPath = " & unixDesktopPath
        set quotedUnixDesktopPath to quoted form of unixDesktopPath
        log "quoted form is " & quotedUnixDesktopPath
        try
            set fromUnix to do shell script "ls -l  " & quotedUnixDesktopPath
            display dialog "ls -l of " & quotedUnixDesktopPath & return & fromUnix
        on error errMsg
            log "ls -l error..." & errMsg
        end try
    end run
    How to set up a folder action.
    1) right click on folder. click on Enable folder actions
    2) Place script in
    /Library/Scripts/Folder Actions Scripts
    3) right click on folder. click on attach folder action
    pick your script.
    Create a new folder on the desktop & try.
    You can put multiple folder actions on a folder. There are other ways of doing this.
    Here is my test script:
    on adding folder items to this_folder after receiving dropped_items
        repeat with dropped_item_ref in dropped_items
           display dialog "dropped files is " & dropped_item_ref & " on folder " & this_folder
        end repeat
    end adding folder items to
    How to  make the text into an AppleScript program.
    Start the AppleScript Editor
    /Applications/AppleScript/Script Editor.app
    In Snow Leopard it's at: /Applications/Utilities/AppleScript Editor
    Copy the script text to the Applescript editor.
    Note: The ¬ is typed as option+return.  ption+return is the Applescript line continuation characters.
    You may need to retype these characters.
    Save the text to a file as an script and do not check any of the boxes below.

  • [Forum FAQ] How to find and replace text strings in the shapes in Excel using Windows PowerShell

    Windows PowerShell is a powerful command tool and we can use it for management and operations. In this article we introduce the detailed steps to use Windows PowerShell to find and replace test string in the
    shapes in Excel Object.
    Since the Excel.Application
    is available for representing the entire Microsoft Excel application, we can invoke the relevant Properties and Methods to help us to
    interact with Excel document.
    The figure below is an excel file:
    Figure 1.
    You can use the PowerShell script below to list the text in the shapes and replace the text string to “text”:
    $text = “text1”,”text2”,”text3”,”text3”
    $Excel 
    = New-Object -ComObject Excel.Application
    $Excel.visible = $true
    $Workbook 
    = $Excel.workbooks.open("d:\shape.xlsx")      
    #Open the excel file
    $Worksheet 
    = $Workbook.Worksheets.Item("shapes")       
    #Open the worksheet named "shapes"
    $shape = $Worksheet.Shapes      
    # Get all the shapes
    $i=0      
    # This number is used to replace the text in sequence as the variable “$text”
    Foreach ($sh in $shape){
    $sh.TextFrame.Characters().text  
    # Get the textbox in the shape
    $sh.TextFrame.Characters().text = 
    $text[$i++]       
    #Change the value of the textbox in the shape one by one
    $WorkBook.Save()              
    #Save workbook in excel
    $WorkBook.Close()             
    #Close workbook in excel
    [void]$excel.quit()           
    #Quit Excel
    Before invoking the methods and properties, we can use the cmdlet “Get-Member” to list the available methods.
    Besides, we can also find the documents about these methods and properties in MSDN:
    Workbook.Worksheets Property (Excel):
    http://msdn.microsoft.com/en-us/library/office/ff835542(v=office.15).aspx
    Worksheet.Shapes Property:
    http://msdn.microsoft.com/en-us/library/office/ff821817(v=office.15).aspx
    Shape.TextFrame Property:
    http://msdn.microsoft.com/en-us/library/office/ff839162(v=office.15).aspx
    TextFrame.Characters Method (Excel):
    http://msdn.microsoft.com/en-us/library/office/ff195027(v=office.15).aspx
    Characters.Text Property (Excel):
    http://msdn.microsoft.com/en-us/library/office/ff838596(v=office.15).aspx
    After running the script above, we can see the changes in the figure below:
    Figure 2.
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Thank you for the information, but does this thread really need to be stuck to the top of the forum?
    If there must be a sticky, I'd rather see a link to a page on the wiki that has links to all of these ForumFAQ posts.
    EDIT: I see this is no longer stuck to the top of the forum, thank you.
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • Find and Replace text string in HTML

    Opps... I hope this forum is not just for Outlook. My Html files reside on my hard-drive. I am looking for VBA code to open specified file names ####File.html and then find and replace text strings within the html for example "####Name" replaced
    with "YYYYY"
    I drive the "####File.html" names and the find and replace text strings from an Excel sheet. I am an artist and this Sub would give me time to paint instead of find and replace text. Thank you!
    [email protected]

    Hello Phil,
    The current forum is for developers and Outlook related programming questions. That's why I'd suggest hiring anybody for developing the code for you. You may find freelancers, for example. Try googling for any freelance-related web sites and asking such
    questions there.
    If you decide to develop an Outlook macro on your own, the
    Getting Started with VBA in Outlook 2010 article is a good place to start from.

  • OSX update 10.10.2 causes mouse to jump around and text to be highlighted randomly in Dreamweaver CC 2014

    OSX update 10.10.2 causes mouse to jump around and text to be highlighted randomly in Dreamweaver CC. When trying to click on a specific line of code in a js file the cursor ends up in a different place in the script and several lines of code highlighted. Clicking again jumps the mouse to a different position and even more lines of code highlighted and some characters rearranged, breaking the lines of code. Very frustrating.

    Preran,
    I am having the same issue. I have a MBP connected to 2 x Dell 27" monitors over Mini DisplayPort to HDMI cables. Once I updated to OS X 10.10.2 this cursor highlight/jumping around issue only occurs on the connected monitors. If I move the program to the main laptop display the issue goes away. It does not require me to restart the program or the machine to make it work correctly. One way I am able to identify the issue is if I go to the line numbers in code like I wanted to select multiple lines - in the one that works correctly, the cursor turns into a white version where the tip of the cursor points to the right. When it is wrong, the cursor stays black and will only have the tip point to the left. Its just another way I identified if it was working cause I tried uninstalling DW and reinstalling - didn't work. Reset preferences as you discussed - no go. And I used other editors like IntelliJ and Adobe Edge Code - all of which work fine and don't display this issue.
    I tried the preferences reset you suggest and it doesn't work. I have another machine with OS X 10.10.1 on it and this issue is not there on any monitor. Any help with this ASAP as it pretty much stops you from being able to do any editing especially with longer pages as it consistently wants to page up when you select anything and if you then click again in another area it tries to move the highlighted code to that new spot.
    Update: I have a USB Microsoft Arch touch mouse connected (always worked just fine). When I go to place my cursor at some point in the code it causes the highlight flicker. If I switch over and use the built in trackpad, then I can place the cursor without the highlight issue. When trying to select multiple lines or sections of code, that still see's the highlight, page up and move of code issues regardless of input type.

Maybe you are looking for