problems with ControlSetText
Posted: 10 Jan 2018, 05:07
Hi everyone. I'm trying to open an address in the active Explorer window (Win10).
I have this code:
But this works only once. Iif I browse to a different folder and hit #k in the message box I see "C:\" and not the actual current path, like AHK didn't get the updated Edit1 field..?
First launch:
Shows correct current path, re-addresses to C:\
Second launch:
I browsed to a different folder and launched script but %curPath% shows C:\ and nothing happens
What am I missing?
Many thanks!
I have this code:
Code: Select all
#k::
IfWinActive, ahk_exe explorer.exe
{
ControlGetText, curPath, Edit1, A
MsgBox, %curPath% ;shows current path
ControlSetText, Edit1, C:\, A
ControlSend, Edit1, {Enter}, A
}
return
First launch:
Shows correct current path, re-addresses to C:\
Second launch:
I browsed to a different folder and launched script but %curPath% shows C:\ and nothing happens
What am I missing?
Many thanks!