Code: Select all
; Usage
MsgBoxCopyText()
; Function
MsgBoxCopyText(Enable:=True) => (HotIfWinActive("ahk_class #32770"), Hotkey("~^c up", (*) => RegExMatch(A_Clipboard, ("s)\R-{27}\R(.*?)\R-{27}\R|\R\R\[.*?\]\R(.*?)\R\R(\[.*?\]\R(.*?)\R\R)?"), &Match) && A_Clipboard := Match[1] != "" ? Match[1] : Match[2] (Match[4] != "" ? "`n" Match[4] : ""), Enable ? "On" : "Off"))