Skip to content

Instantly share code, notes, and snippets.

@q8f13
Last active August 14, 2019 04:19
Show Gist options
  • Save q8f13/83585561735b01d83a491917313b5d9f to your computer and use it in GitHub Desktop.
Save q8f13/83585561735b01d83a491917313b5d9f to your computer and use it in GitHub Desktop.
close tab windows in unity; alt+f4 may cause misoperation to closing whole editor
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
setWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetTitleMatchMode RegEx
; close tab windows in unity; alt+f4 may cause misoperation-leading to closing whole editor
#IfWinActive ^$
^W::
WinGetPos, X, Y, Width, Height, A
MouseGetPos, xpos, ypos,
nposx := Width - 12
; MsgBox, the active window is at %X%, %Y% with %Width%, %Height%, mouse at %xpos%, %ypos%, calc result is %nposx%,%ypos%
MouseClick, left, %nposx%, 8
return
#IfWinActive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment