4 Replies Latest reply on Dec 27, 2009 5:38 PM by Mac_06

    Find Text in Labeled Text Frames

    Mac_06 Level 2

      Hello All

       

      I am bit primitive in script writing, i do have one script which find and replace text but it doesn't find the text in only specific labeled text frame on Master pages also it retruns the error in

      var myChange=app.changeTextPreferences.changeTo=myString;
      as it cancelled.

       

      if(myDialog.show() == true){
        var myString;
        //If the user didn’t click the Cancel button,
        //then get the values back from the dialog box.
        //Get the example text from the text edit field.
        myString = myTextEditField.editContents
        }
      }
      }

      app.findTextPreferences=NothingEnum.NOTHING
      app.changeTextPreferences=NothingEnum.NOTHING

      if(myDoc.textFrames.Item("head")){
      app.findChangeTextOptions.includeLockedLayersForFind = false;
      app.findChangeTextOptions.includeLockedStoriesForFind = false;
      app.findChangeTextOptions.includeHiddenLayers = true;
      app.findChangeTextOptions.includeMasterPages = true;
      app.findChangeTextOptions.includeFootnotes = false;
      app.findChangeTextOptions.caseSensitive = true;
      app.findChangeTextOptions.wholeWord = true;
      var myFind=app.findTextPreferences.findWhat = "xxxx";
      var myChange=app.changeTextPreferences.changeTo=myString;
      app.activeDocument.changeText ();
      }

       

      Could any one figure it out.

      many Thanks in advance