Searching multiple words

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
silverblade

Searching multiple words

31 May 2016, 22:12

Hi Ppl,

I'm trying to accomplish something like the below:

So search few set of standard words like - been, had, become, the, went, gendy - in a document. Instead of typing this every time using "Ctrl+F" (find key) and pressing enter key, i want to automate it using ahk. When i press ` key each time one word from the list should be searched and when i press ` again the next word should be searched.

I know I can use the "send" command to initiate the search dialogue box (ctrl+f) how to search the words in the list using ahk?
gilliduck
Posts: 265
Joined: 06 Oct 2014, 15:01

Re: Searching multiple words

31 May 2016, 23:31

Untested, but should do the trick, or at least close to it with a little tweaking.

Code: Select all

#EscapeChar *

wordsToSearch := ["been", "had", "become", "the", "went", "gendy"]

`::
increment += 1
if (increment > wordsToSearch.MaxIndex())
	increment := 1
searchWord := wordsToSearch[increment]
send, ^f
sleep 500
send %searchWord%
Return
silverblade

Re: Searching multiple words

01 Jun 2016, 00:13

I tried this and there need to be few modifications.

1. The words that needs to be searched comes in the search text box but the enter key is not pressed.

2. When i press the ` again, it should open a new search box and then the next word should go in there instead of updating the new word in the same text box which has the previously searched word.
gilliduck
Posts: 265
Joined: 06 Oct 2014, 15:01

Re: Searching multiple words

01 Jun 2016, 01:34

Ok, that shouldn't be too difficult to tweak. The help documentation should have everything you need for doing that. At this point it's really just a matter of replicating the keystrokes that you would manually perform to replicate the same task. The hard part I did for you (the array, changing the escape character so you could use ` as a hotkey, and the increment variable/check).
silverblade

Re: Searching multiple words

01 Jun 2016, 05:45

thanks for your help. I will tweak and keep you updated

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Theda and 274 guests