Close and DON'T save file

That’s great! I had no idea you could use patterns in Press a Button.

Suppose I couldn’t though. I am sure this has been asked before but I can’t figure out how to find it: is there any way to have a series of actions, where the series (or macro itself) is exited once one of the actions succeeds? I know I can terminate the macro on failure, but I don’t know how to do something on success.

  • Press Button “Whatever”, no notification, no aborting
  • If text %ActionResult% is not OK
    • Press Button “Whatever Else”, no notification, no aborting
    • If text %ActionResult% is not OK
      • Press Button “Whatever Else”, no notification, no aborting
      • etc

They have to be nested as otherwise the If action will succeed at doing nothing and set %ActionResult% to OK.

To avoid nesting, you could do something like:

  • Press Button “Whatever”, no notification, no aborting
  • Set variable Result to %ActionResult%
  • If variable Result is not OK
    • Press Button “Whatever Else”, no notification, no aborting
    • Set variable Result to %ActionResult%
  • If variable Result is not OK
    • Press Button “Whatever Else”, no notification, no aborting
    • Set variable Result to %ActionResult%
  • etc

This is different. It is an error dialog. It has only one button, which you must press (or, since it is selected, type Return).

1 Like

The above macro works fine with one open tab.
How would I modify it for multiple tabs, ie make it recursive in the sense that each tab is closed in sequence until all tabs are closed.
thanks very much

Well, this is probably app dependent, but you might try this, assuming your documents are all in windows with a name:

  1. set KM variable (WinName) to name of frontmost window
  2. Repeat while WinName is not empty
    1. Execute the above macro/actions
    2. set KM variable (WinName) to name of frontmost window
    3. Maybe a short Pause (0.1 sec)
1 Like

Could you give me just a hint as to which actions I would use to do so ?
Thank you very much !

Have you tried using the Insert Action by Name in the Edit menu (or ⌃⌘A)?

Invoke this tool, and type in a key word, like:

  • set variable
  • while
  • execute macro
  • pause
1 Like

thank you very much !
It was the set variable and while that I was not familiar with.