Yeah, once the app quits, it's no longer there for the macro action to work on. Two ideas occur to me:
If you always use ⌘-Q to quit your applications, you could change the macro trigger to ⌘-Q, run your clear action (maybe with a Pause Untillast action result is okay or similar) and then another Select Menu action to quit the app.
Alternatively, if you don't always quit apps with ⌘-Q, you could trigger your clear action macros on application launch instead.
Hemi gave two very good suggestions for you that should work well. (Although some apps may need a certain amount of Pausing for his second idea to work.)
No, because when macOS gets (ie, issues) the trigger, the app has already quit, or is in the process of quitting.