0 Replies Latest reply on Aug 22, 2011 9:12 AM by Tom Tomasko

    [JS CS3] How to load Find/Change dialog?

    Tom Tomasko Level 1

      Hello,

       

      Below is a script that uses GREP to find straight apostrophies and then change them to smart (curly) ones. The script invokes the Find/Change dialog so that the user can see what she or he is doing.

       

      However, if the user last used the Find/Change dialog in the TEXT mode, that is the mode that appears. I want the script to go to the GREP mode. I see that there is code for app.loadFindChangeQuery(queryName, searchMode), but I have no idea what the "queryName" is and how to use it in this script.

       

      Thanks for any help.

       

      Tom

       

      theGrepLoader("~'", "~]");

      function theGrepLoader(grepFindIt, grepChangeIt){
          app.findGrepPreferences = NothingEnum.NOTHING;
          app.changeGrepPreferences = NothingEnum.NOTHING;
          app.findGrepPreferences.findWhat = grepFindIt;
          app.changeGrepPreferences.changeTo = grepChangeIt;
          app.menuActions.item("Find/Change...").invoke();
      }//end theGrepLoader