Reputation: 167
Really struggling with this.
I need to simply open a windows explorer window at a specified domain, wait until it is active then proceed. This is what I have so far:
#::
{
WinGet, old_active, ID, A
Run, explore C:\Users\Nathan\Documents\Test FDA
loop{
WinGet, new_active, ID, A
if(ahk_id %new_active% != ahk_id %old_active%)
{
WinMaximize, A
break
}
}
return
}
EDIT SOLVED ?>>>
DIDNT KNOW WINDOW SPY EXISTED CAME WITH IT :(((
Long time wasted, this simply works.
[::
{
Run explore C:\Users\Nathan\Documents\Test FDA
WinWaitActive Test FDA
WinMaximize A
return
}
Upvotes: 3
Views: 4013
Reputation: 21
how about this?:
" F12:: WINDOWEXPLORER: WinWaitActive, Windows Explorer,, 0.01 if ErrorLevel { Goto WINDOWEXPLORER } else { ; SoundBeep 4500, 30 Return } "
Upvotes: 2
Reputation: 4550
I think you are looking for the WinWaitActive
function. From the documentation:
Waits until the specified window is active
Put it after the line with Run...
:
WinWaitActive, WinTitle
You will need to replace WinTitle
with the title of the window that comes up after the Run
command. There are other options available, such as duration to wait, titles to exclude, etc.
See the documentation for more details.
Upvotes: 0