[solved] Close process when Window Title detected

Get help with using AutoHotkey and its commands and hotkeys
robhayes
Posts: 19
Joined: 28 Dec 2015, 15:35

[solved] Close process when Window Title detected

02 Jan 2016, 13:32

Hello,

I am trying to have my script close YoutubeDLG upon complete.

Code: Select all

^PgDn::
run, C:\Program Files (x86)\YoutubeDLG\youtube-dl-gui.exe
Sleep 1500
Send, ^v
Sleep 100
Send, %A_Tab%
Send, {Enter}
; NEED LINE HERE TO DETECT WINDOW TITLE 'Info' (http://i.imgur.com/BA7Inoy.jpg)
process close, youtube-dl-gui.exe ; only if Window Title 'Info' Detected
return
Thank you in advance.
Last edited by robhayes on 02 Jan 2016, 13:49, edited 1 time in total.
GEV
Posts: 844
Joined: 25 Feb 2014, 00:50

Re: Close process when Window Title detected

02 Jan 2016, 13:47

Code: Select all

---
Send, {Enter}
;WinWait, WinTitle, WinText, Seconds, ExcludeTitle, ExcludeText
WinWait, Info ahk_class #32770, OK
process close, youtube-dl-gui.exe ; only if Window Title 'Info' Detected
return

Return to “Ask For Help”

Who is online

Users browsing this forum: ark, Bing [Bot], milkygirl90, nutnutwin and 26 guests