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?
Searching multiple words
Re: Searching multiple words
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
Re: Searching multiple words
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.
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.
Re: Searching multiple words
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).
Re: Searching multiple words
thanks for your help. I will tweak and keep you updated
Who is online
Users browsing this forum: Theda and 274 guests