Save and Quit Application for a Beginner

I have too few Ram on an old iMac, so I am trying to close applications as soon as I use them. I am a clumsy beginner with no programming knowledge, so I just open the apps that I need for a particular project and then close every other possible app that I could be using. The problem is automatically closing programs that require saving of the document. I see @haptic is force quitting a stubborn program, but I am not sure I need that much force. Is it a good idea since if I stopped working on writing a document, generally I would be happy to force quit it. Or should get the macro to stop and blink a light etc. so I can save it manually.

I also saw that @anamorphic wanted to do this this with any app. I see the "Make Notes Path name" etc., but am not sure if I need something specific for %TriggerValue% or /Applications/_APPLICATION NOTES/5Variable%appName%Notes.ooutline ect.

There was never a reply to @anamorph's problems with closing some apps.

Maybe I should read something so that I can understand what I am asking about. Or maybe I should give up because these kinds of values are beyond me.

Personally, I would just make sure to close apps I'm not using before opening another app. ⌘Q is pretty quick to use, and you can mostly just keep using it to close all apps except for Finder, which can't be closed at all of course. But you could use ⌘Tab to get past Finder.

I don't think having a macro close all your open apps is a good idea, because each app handles the issue of saving changes differently. If there are certain apps that you'll never want to save changes when you close them, then you could write macros to handle that, so all you have to do is ⌘Q them.

I suppose if there's apps you always want to save changes, you could probably write macros for that as well.

And if you can help it, it's generally not a good idea to force-close apps. I could be wrong, of course, but it doesn't seem like a good habit to get into.

So what do you think you want to do?

@Ellenm what Mac model do you have? Is adding RAM feasible?

Thank you Dan. I will try the "change your habit option." A little discipline is needed.

@hello Unfortunately a late 2012 iMac is worth less than the Ram change and then there are other problems. I should not have updated to Catalina.