carpometacarpal*carpometacarpal*The carpometacarpal joint of the thumb (pollex), also known as the first carpometacarpal joint, or the trapeziometacarpal joint (TMC) because it connects the trapezium to the first metacarpal bone, plays an irreplaceable role in the normal functioning of the thumb.
1st*first*
first*1st*
It usually works perfect but with the ones I have above I see this problem. Since it is parsing I assume the whole section from top down it is seeing the word first in the definition part of carpometacarpal and sending the carpometacarpal. I want it to only search the first word in the section and if that is found, send the second part and msgbox the definition. Those last 2 parts I think I have down fine. It's the only matching the first part. I'm sure it can be done with regex but I'm not good at that yet and I'm hoping for something I can understand so I can use in other places easily if need be.
Thank you very much in advance and I hope that makes sense.
Code: Select all
Capslock & j::
; ask forum how to instring only the first part individually but if the third section exists and only send - not parse - that if first part only matches
Numpad1::
SetStoreCapslockMode off
Gosub wordsaveoptions2 ; this just chooses and copies the word(s) I'm looking to search with
Sleep 300
SearchText := clipboard ; added " to try cause someone else used them
Loop, read, C:\Dropbox KHGmail\Dropbox\AHK\dictionary definition popup.txt
IfInString, A_LoopReadLine, %searchtext% ; worked was okay
{
{
;msgbox, 4, , %searchtext% found, 1
Loop, parse, A_LoopReadLine, *
StringSplit, string, A_LoopReadLine, *, ; %A_Space%
Ifinstring, A_LoopReadline, %searchtext%
If searchtext = %string2%
;Msgbox, 0, IT IS HERE, I EXIST %string2%, 0.7
Send {DELETE}
SetStoreCapslockMode off
SLeep 350
Send %string2%
}
If String3 is space
{
;msgbox, 0, , the definition is missing, 1
SetStoreCapslockMode off
Reload
Return
}
Else
If String3 is not space
{
SetTimer, WinMoveMsgBox2, 50
Msgbox, 0, Found it!!!, Searched ~~~ %String1%`n`n`nCorrected Version ~~~ %String2%`n`n`nDefinition ~~~`n`n%String3%, 6
SetStoreCapslockMode off
Return
}}
SearchText = %searchtext%
IfnotInString, A_LoopReadLine, "%searchtext%" || IfnotInString, A_LoopField, "%searchtext%"
{
Msgbox, 0, IT IS NOT HERE, NOT FOUND %searchtext% in search string, 0.7
Send %searchtext%
SetStoreCapslockMode off
Return
}
SetStoreCapslockMode off
Return
wordsaveoptions2: ; for temporary hotkey saving
Msgbox, 0, How many, Choose how many words., 0.3
wordsaveoptionsnomsgbox:
clipback := ClipboardAll
clipboard=
Input, Character, L1 T1
if (ErrorLevel = "Timeout")
{
Send {CTRLDOWN}{SHIFTDOWN}{RIGHT}{CTRLUP}{LEFT}{SHIFTUP}
Sleep 300
Send {CTRLDOWN}c{CTRLUP}
Sleep 300
ClipWait
return
}Else
If ((character ~= "1|o"))
{
Send {CTRLDOWN}{RIGHT}{CTRLUP}{SPACE}{CTRLDOWN}{LEFT}{CTRLUP}{DELETE}{CTRLDOWN}{SHIFTDOWN}{LEFT}{CTRLUP}{SHIFTUP}{CTRLDOWN}c{CTRLUP}
Clipwait, 1
}
Else
If ((character ~= "2|t"))
{
Send {CTRLDOWN}{RIGHT 2}{CTRLUP}{SPACE}{CTRLDOWN}{LEFT}{CTRLUP}{DELETE}{CTRLDOWN}{SHIFTDOWN}{LEFT 2}{CTRLUP}{SHIFTUP}{CTRLDOWN}c{CTRLUP}
ClipWait
}
Else
If ((character ~= "3|w"))
{
Send {CTRLDOWN}{RIGHT 3}{CTRLUP}{SPACE}{CTRLDOWN}{LEFT}{CTRLUP}{DELETE}{CTRLDOWN}{SHIFTDOWN}{LEFT 3}{CTRLUP}{SHIFTUP}{CTRLDOWN}c{CTRLUP}
ClipWait
}
Else
If ((character ~= "f|4"))
{
Send {CTRLDOWN}{RIGHT 4}{CTRLUP}{SPACE}{CTRLDOWN}{LEFT}{CTRLUP}{DELETE}{CTRLDOWN}{SHIFTDOWN}{LEFT 4}{CTRLUP}{SHIFTUP}{CTRLDOWN}c{CTRLUP}
ClipWait
}
Else
If ((character ~= "v|5"))
{
Send {CTRLDOWN}{RIGHT 5}{CTRLUP}{SPACE}{CTRLDOWN}{LEFT}{CTRLUP}{DELETE}{CTRLDOWN}{SHIFTDOWN}{LEFT 5}{CTRLUP}{SHIFTUP}{CTRLDOWN}c{CTRLUP}
ClipWait
}
Else
If ((character ~= "6|x"))
{
Send {CTRLDOWN}{RIGHT 6}{CTRLUP}{SPACE}{CTRLDOWN}{LEFT}{CTRLUP}{DELETE}{CTRLDOWN}{SHIFTDOWN}{LEFT 6}{CTRLUP}{SHIFTUP}{CTRLDOWN}c{CTRLUP}
ClipWait
}
Else
If ((character ~= "7|n"))
{
Send {CTRLDOWN}{RIGHT 7}{CTRLUP}{SPACE}{CTRLDOWN}{LEFT}{CTRLUP}{DELETE}{CTRLDOWN}{SHIFTDOWN}{LEFT 7}{CTRLUP}{SHIFTUP}{CTRLDOWN}c{CTRLUP}
ClipWait
}
Else
if Character=S
{
Reload
}
Return