I am trying to create a script where autohotkey searches for a certain text, and then pastes text that comes following the last letter of what was found.
Here's an example:
Section: 213
Row: 13
Seat: 9-12
Confirmation Number: 70-30642/NY1
Order Summary: $755.00
Ok. Now here's my code so far:
Code: Select all
#persistent
Haystack := clipboard ; I copy that whole example above into the clipboard
Needle1 = InStr(Haystack, SEC, False, 3)
Needle2 = InStr(Haystack, ROW, False, 3)
Needle3 = InStr(Haystack, SEAT, False, 3)
Needle4 = InStr(Haystack, Confirmation Number, False, 3)
Needle5 = InStr(Haystack, Order Summary, False, 3)
^b:: ;paste the specified words that were found in the clipboard
If InStr(Haystack, Needle1)
SendInput, %Needle1% ;I want the program to paste "213"
SendInput, %Needle2% ;I want the program to paste "13"
SendInput, %Needle3% ;I want the program to paste "9-12"
SendInput, %Needle4% ;I want the program to paste "70-30642/NY1"
SendInput, %Needle5% ;I want the program to paste "$755.00"
return
How do I get ahk to paste the WORD of the found string and not the position in number format?