controlsend to notepad2 not sending text
Posted: 12 Feb 2015, 01:43
I was trying a script to send text to notepad2 but not sending anything.
It does launch notepad (notepad2.exe on my system) but no text is sent.
My question is what needs to be changed in the script?
It does launch notepad (notepad2.exe on my system) but no text is sent.
My question is what needs to be changed in the script?
Code: Select all
#singleinstance,force
pr=notepad
sc=ahk_exe Notepad2.exe
ClassNN=SysListView321
Gui,2: Add, Button, x10 y60 h25 w160 gA1,Write to Notepad
Gui,2: Show,x10 y10 h90 w200,Run_Notepad
Gui,2: Add, Edit, x10 y10 h40 w180 vE1,%a_space%TEST1`n%a_space%TEST2`n
return
2Guiclose:
exitapp
A1:
Gui,2: Submit, nohide
IfWinNotExist,%sc%
{
Run, %pr%,,,pid1
WinWait,%SC%
IfWinNotActive ,%SC%,,WinActivate,%SC%
WinWaitActive,%SC%
}
ControlSend,%classnn%,%e1%,%sc%
return