Close window with title?

I don't find any action to close a window with a specific title.

Does it exists something like this or I must use an if…then condition?

I don't think there's such action, but you want to close the app itself or only a single window, with a specific title, from this app? What is your use-case?

There is the activate window with title action, you can use that followed by a cmd+w shortcut

Thanks for your answers. I have configured it with a if…then+click menu item "close window".

@Andreas_Hegenberg maybe you could consider to add two actions in new versions:

  • close window with title
  • close all windows of active app

You can do this with AppleScript (Action):

set theTitle to "Your window title"

tell application "System Events"
	set theProcesses to every process where background only is false
	repeat with theProcess in theProcesses
		tell theProcess
			repeat with theWindow in windows
				if name of theWindow contains theTitle then
					click button 1 of theWindow
					return
				end if
			end repeat
		end tell
	end repeat
end tell