Clear (File > Open Recent) Recents on Quit

I think I'm running into a logic / causality issue here:

I want Preview (or indeed any app) to clear its Recent Documents (File > Open Recent > Clear Menu) on Quit

But it fails, I assume because the Quit event means the menu isn't there to be selected.

So is there something I can do to pause the Quit until the Clear Menu task has finished?

Yeah, once the app quits, it's no longer there for the macro action to work on. Two ideas occur to me:

  1. 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 Until last action result is okay or similar) and then another Select Menu action to quit the app.
  2. Alternatively, if you don't always quit apps with ⌘-Q, you could trigger your clear action macros on application launch instead.
1 Like

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.

1 Like

There's always an out of the box solution that makes me feel a bit dense :wink:

Cheers.

2 Likes

One thing, I had to add a conditional in case there was nothing in the Recents