4 Replies Latest reply on Jan 3, 2012 3:25 AM by Peter Spier

    TIP: Clean slate for find/change

    TᴀW Adobe Community Professional & MVP

      Hi,

       

      Sharing a little tip I just thought of. Very straightforward and

      obvious, but quite useful, and I haven't noticed it mentioned elsewhere.

       

      If you're doing a lot of find/replace, you'll repeatedly need to remove

      all selections and start with a clean slate (nothing in the find/replace

      fields, clear all formatting).

       

      It seemed to me for a while that we're missing a "Clear All" button in

      the find/replace box.

       

      So the answer is simple: clear everything, all options, etc., and save

      it as a find/replace query.

       

      Now whenever you need a clean slate for find/save, just select that query.

       

      It's working nicely for me!

       

      Happy new year,

      Ariel

       

        • 1. Re: TIP: Clean slate for find/change
          [Jongware] Most Valuable Participant

          Funny thing it's possible to save an empty query

           

          (After trying:) You can also save this little Javascript and bind it to your default Find Text hotkey combo.

           

          app.findTextPreferences = app.changeTextPreferences = null;
          app.findGrepPreferences = app.changeGrepPreferences = null;
          app.menuActions.item("$ID/EditMenu_FindChange").invoke();
          

           

          -- but (sob) it's still not possible to preselect either Text or GREP mode.

          • 2. Re: TIP: Clean slate for find/change
            TᴀW Adobe Community Professional & MVP

            "Funny thing it's possible to save an empty query :D"

             

            Right, that's the counterintuitive bit!

             

            Nice scriplet, but sometimes one does want to keep the old values, and

            also sometimes its necessary to clear all preferences without dismissing

            the dialog.

             

            Ariel

            • 3. Re: TIP: Clean slate for find/change
              John Hawkinson Level 5

              Nice scriplet, but sometimes one does want to keep the old values, and

              also sometimes its necessary to clear all preferences without dismissing

              the dialog.

              Jongware's solution, as proffered, solves the first of these. When you want to keep the old values, simply use the menu to access Find, rather than the redefined shortcut that goes through the script.

               

              If you're truly doing a lot of these, maybe you want to look at FindChangeByList.jsx as well as the various enhancements others have come up with...

              • 4. Re: TIP: Clean slate for find/change
                Peter Spier Most Valuable Participant (Moderator)

                I was going to stay out of this, but find I can't. Sometimes it seems to me that scripters see everything as being better solved through scripting.

                 

                I actually think Ariel's observation about saving a blank query is quite brilliant, and I have to agree that there are times, and plenty of users like me who don't use a KB hortcut to access find change, where users will find having the saved blank query much faster than any other method of clearing the dialog. Both methods have their place, but I find it disingenuous to say that Jongware's scriptlet "solves" the case where you want to keep the old values -- it actually complicates things as you then must remember if you are to run the KB shortcut, or use the menu, to acieve the desired result.

                 

                I think it would be far better to say that this, like many things in ID, can be accomplished in more than one way, and that they way you do it may be different at different times, and that the mehod of choice is exactly that, a choice subject to the user's own preference.