For my project I need a program that exports text or spreadsheet data to other programs like word, excel, notepad, etc.. The user will set his cursor in the application he wants to export to, then he clicks in my program on "export", which will start the autohotkey .exe. I already figured out how to get the window of the other application, but not how to send the data.
Here is the current code:
WinGet, id, list
window_id := id3 ;id2 = current program, id3 = program behind (we want to send the data here)
ControlSendRaw, , MyExportDataHere, ahk_id %window_id% ;<-------- DOESNT WORK
;~ ///////////// Works, but ugly because of popup:
;~ window_id := id3
;~ WinActivate, ahk_id %window_id%
;~ SendRaw MyExportDataHere
;~ window_id := id2
;~ WinActivate, ahk_id %window_id%