# Auto-Close Apps When All Windows Have Been Closed

**URL:** <https://community.folivora.ai/t/auto-close-apps-when-all-windows-have-been-closed/44148>\
**Category:** Setup/Preset Sharing\
**Tags:** preset\
**Created:** [June 22, 2025, 11:17pm UTC](https://community.folivora.ai/t/auto-close-apps-when-all-windows-have-been-closed/44148 "2025-06-22T23:17:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hugoh](https://community.folivora.ai/letter_avatar_proxy/v4/letter/h/45deac/32.png) [@hugoh](https://community.folivora.ai/u/hugoh)\
**Post date:** [June 22, 2025, 11:17pm UTC](https://community.folivora.ai/t/auto-close-apps-when-all-windows-have-been-closed/44148/1 "2025-06-22T23:17:09Z")

</div>

I implemented a preset which closes specific apps when they've been inactive for a while.

[autoclose-apps.bttpreset](https://community.folivora.ai/uploads/short-url/stZ3IsI12HsRMtuBcrsZyxa7WgN.bttpreset) (8.0 KB)

This is a JavaScript script triggered by deactivation of an app.

Right now, the configuration is straight in the source –30 minutes of inactivity for the following apps:

```js
  let delaySeconds = 60 * 30;

  const allowedBundleIds = [
    "com.microsoft.Excel",
    "org.mozilla.firefox",
    "com.apple.iWork.Keynote",
    "com.apple.iWork.Numbers",
    "com.apple.iWork.Pages",
    "com.microsoft.Powerpoint",
    "com.apple.Preview",
    "com.apple.Terminal",
    "com.microsoft.Word"
  ];

```

---

<div class="post-metadata">

**Author:** ![tosbsas](https://community.folivora.ai/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@tosbsas](https://community.folivora.ai/u/tosbsas)\
**Post date:** [March 12, 2026, 5:44pm UTC](https://community.folivora.ai/t/auto-close-apps-when-all-windows-have-been-closed/44148/2 "2026-03-12T17:44:16Z")

</div>

the new pages/Keynote and Numbers seem to have other bundle ids. Works perfect with Microsoft but those are not working. Any idea?

I think ist com.apple.pages now

How would you add Zoom?

---

<div class="post-metadata">

**Author:** ![fortred2](https://community.folivora.ai/letter_avatar_proxy/v4/letter/f/e79b87/32.png) [@fortred2](https://community.folivora.ai/u/fortred2)\
**Post date:** [March 12, 2026, 6:01pm UTC](https://community.folivora.ai/t/auto-close-apps-when-all-windows-have-been-closed/44148/3 "2026-03-12T18:01:15Z")

</div>

Hi @tosbsas,

You can run this command in your terminal to obtain the bundle ID for any app on your Mac:

```bash
osascript -e 'id of app "Pages"'

```

The output is this:

```auto
com.apple.Pages

```

For Zoom, the app name is `zoom.us`, so you get this:

```shell
╭─   ~ ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────  19:00:03
╰─❯ osascript -e 'id of app "zoom.us"'
us.zoom.xos

```

I hope this helps.

---

<div class="post-metadata">

**Author:** ![tosbsas](https://community.folivora.ai/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@tosbsas](https://community.folivora.ai/u/tosbsas)\
**Post date:** [March 12, 2026, 11:20pm UTC](https://community.folivora.ai/t/auto-close-apps-when-all-windows-have-been-closed/44148/4 "2026-03-12T23:20:53Z")

</div>

found it and put it in the script, but its not doing its job with those apps. Only Office 365 apps so far

"com.microsoft.Excel",

```
"org.mozilla.firefox",

"com.apple.Keynote",

"com.apple.Numbers",

"com.apple.Pages",

"us.zoom.xos",

"com.microsoft.Powerpoint",

"com.apple.Preview",

"com.apple.Terminal",

"com.microsoft.Word"

```

This it what it looks like in BTT

---

<div class="post-metadata">

**Author:** ![tosbsas](https://community.folivora.ai/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@tosbsas](https://community.folivora.ai/u/tosbsas)\
**Post date:** [March 14, 2026, 7:05pm UTC](https://community.folivora.ai/t/auto-close-apps-when-all-windows-have-been-closed/44148/5 "2026-03-14T19:05:48Z")

</div>

anyone got an idea? Looks like the Standard Apple Apps are not being touched by the script. Whole Office Suite, Terminal or Preview are not closing, Office 365, Evernote and Zoom do @hugoh

---

<div class="post-metadata">

**Author:** ![tosbsas](https://community.folivora.ai/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@tosbsas](https://community.folivora.ai/u/tosbsas)\
**Post date:** [March 25, 2026, 1:19pm UTC](https://community.folivora.ai/t/auto-close-apps-when-all-windows-have-been-closed/44148/6 "2026-03-25T13:19:18Z")

</div>

anyone @hugoh
