Find All Occurrences Macro
-
I have a find all macro that works with hardcoded search string (TODO) but is there a way to create a macro that does find all for the current highlighted word?
This works for hardcoded “TODO …”:
<Macro name="TODO Find All" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="TODO:|BUG:|FIX:|REFACTOR:|DONE:|INFO:" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1702" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1636" sParam="" /> </Macro>This does not work for the current word:
<Macro name="TODO Find All" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="$(CURRENT_WORD)" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1702" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1636" sParam="" /> </Macro>Cheers.
-
@Michael-Vincent said in Find All Occurrences Macro:
is there a way to create a macro that does find all for the current highlighted word?
Sadly, no. Even more useful would be something like
$(PROMPT)which would put up an input box for a user search term to be supplied. -
Hello, @michael-vincent, @alan-kilborn and All,
Michael, may be I’m missing something obvious !
Why don’t you use your macro, via its shortcut ( search of
TODO:|BUG:|FIX:|REFACTOR:|DONE:|INFO:) to get one instance of the title, presently needed, and then, simply use theCtrl + F3orCtrl + Shift + F3shortcuts to move around to the next or previous similar title ?Best Regards,
guy038
-
@guy038 said in Find All Occurrences Macro:
Why don’t you use your macro, via its shortcut ( search of TODO:|BUG:|FIX:|REFACTOR:|DONE:|INFO: ) to get one instance of the title, presently needed, and then, simply use the Ctrl + F3 or Ctrl + Shift + F3 shortcuts to move around to the next or previous similar title ?
Thanks, and not to be rude, but that kind of defeats the purpose. Maybe I should have explained a little better. When I mean “Find all Occurrences” I want the search results window to pop up with all occurrences the same as when I:
- highlight a word
- press CTRL-F
- press “Find All in Current Document”
By making this a macro, I can then add it to the context menu and then a right-click on any word will have a click away, “Find All Occurrences” which will open the clickable search results window.
Hope that better explains, seems it may not be possible though. Shame the $(CURRENT_WORD) variable can be used in the shortcuts.xml file for the <UserDefinedCommands> commands section, but not the <macros> section.
Cheers.,
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login