I used MS Excel sheet for tests but it failed to work. My script is this:
F1::
ControlGetText, OutputVar, Edit1, ahk_class XLMAIN
Return
F2::
Send %OutputVar%
Return
So when I press hotkey F1, the script should retrieve the text of edit box and when I press hotkey F2 it should send that text, but it is doing nothing on pressing these keys.
As you can see in this snapshot:
(All the control IDs are only for the purpose of testing)