Force closing documents that contain specific names

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
autohotkeycool
Posts: 137
Joined: 24 May 2016, 08:23

Force closing documents that contain specific names

17 Sep 2021, 04:02

I'm currently using the program libre calc and I have documents that are called called "untitled 1 - LibreOffice Calc" https://i.imgur.com/vbhe0Gu.png and "untitled 2 - LibreOffice Calc"and I'm wondering what AHK script would you use to just close these documents that contain "untitled" in them?
User avatar
mikeyww
Posts: 26897
Joined: 09 Sep 2014, 18:38

Re: Force closing documents that contain specific names

17 Sep 2021, 05:32

Code: Select all

; SetTitleMatchMode, 2 ; Use if "untitled" is not the leading text
WinGet, win, List, untitled
Loop, %win%
 WinClose, % "ahk_id " win%A_Index% ; WinKill is an alternative

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: ccqcl, claudiosxj, Exies, Google [Bot], Rohwedder and 232 guests