Code: Select all
#Requires Autohotkey v2.0+
#Include <UIA>
cUIA := UIA.ElementFromHandle("ahk_exe opera.exe")
if (foundElement := cUIA.WaitNotExist({Type:"TabItem""}))
WinClose()
Code: Select all
#Requires Autohotkey v2.0+
#Include <UIA>
cUIA := UIA.ElementFromHandle("ahk_exe opera.exe")
if (foundElement := cUIA.WaitNotExist({Type:"TabItem""}))
WinClose()
Code: Select all
#Requires Autohotkey v2.0+
#Include <UIA>
#Include <UIA Browser>
cUIA := UIA.ElementFromHandle("ahk_exe opera.exe")
q::{
Loop {
if (foundElement := cUIA.WaitNotExist({Type:"TabItem", LocalizedType:"tab item"}))
try cUIA.FindElement("Y/YYYY0/").Click() ; Close button
}}