Use BTT to quit application after last window is closed

Hi,

I'm wondering if anyone could tell me any way (through BTT or any other method) of having my Mac quit an app after I close the last window of that application. For example, I really don't like how when I open a picture with preview and close the window with the red x button, the preview icon still stays in my dock and clutters it up.

With BTT, I know I can assign an application to quit once I press the red x button, but then it quits all windows of that app, which I usually don't want.

I know there is an application called RedQuits, which does pretty much what I want, but it drains my battery like crazy and makes safari act weird, so it's a no go until it gets updated.

Any help is appreciated.

Please see my suggestion at https://community.folivora.ai/t/app-quits-when-last-window-is-closed/8836/5.