Close All Windows

I have been looking around and I don’t think this has been covered before, at least, I have not been able to find the answer. I have a new app that I like, Curio. It’s great for all sorts of things involved in brainstorming and putting ideas on a whiteboard to organize work-flow, etc. The trouble is, it opens with every previously open window reopened. That may be fine for some, but I prefer to start with a clean slate, Curio can open with a project gallery window that shows me all the things I was thinking of working on anyway.

Using KM, I don’t see a way to tell Curio to close all of it’s open windows. I have already posted a similar version of this same question on the Curio forums. I was wondering if in KM, there is a way to assess how many documents an app has running (as shown in the windows menu of every app I have seen). I want to close windows and repeat (n) times where (n) = number of windows open.

As I am just getting stated with Curio and I am just beginning to move projects over to that work environment. I have a relatively small number of past projects open, repeat 4 times should do the job. Of course, I get an annoying system error beep each time there are no windows to close so, some precision with this would be useful.

UPDATE: The Curio developer responded that there is a Terminal command I can use to change this default behavior. Now Curio does not open with all previously open windows. I am going to leave this question posted as it is still a useful idea to know about closing all windows in the windows menu.

The usual incantations for a KM Execute … Script action would be either:

JavaScript for Automation (JXA)

var curio = Application('Curio');



Application('Curio').windows().map(w => w.close())


tell application "Curio" to close windows
1 Like

Thanks, makes sense.