Do Don't Save

EDIT: 2016-09-13 23:47 CT (Tue)

New version 1.2: some fixes.

Do Don't Save ➜ 1.2.kmmacros (21 KB)

This macro clicks a button in the current Save dialog: "Don't Save", "Delete", or "Delete Copy". Create macros that call it and bind them to a keystroke. See macro for more details.

1 Like

Just to be clear for me (after reading your Applescript), that if I want your macro to, for example, always click the Don't Save button, I would edit this line in your script...

property theButtonNames : {"Don’t Save", "Delete", "Delete Copy"}

...so that it only reads...

property theButtonNames : {"Don’t Save"}

... is that correct?

Yes, theButtonNames is a list of the names of the buttons the macro will search for and press.

Your question gets me thinking that making the macro general like that was maybe not the bet way to handle things. The generality was so it could be used by multiple applications, but in general each application will use only one. Perhaps it would be better to pass the button name(s) to the macro that looks for it. I say button names because sometimes an application will use different button names in different situations. (For instance, TextEdit says Delete Copy if you attempt to close a document that is a copy of another (i.e., was created with ⇧⌘S), but Delete if you are simply closing a document you have modified.

New version 1.2: some fixes.

Do Don't Save ➜ 1.2.kmmacros (21 KB)

In order to make sure new readers see your latest version, the usual practice is to update your Original Post (OP) with the new version, and add a line near the top indicating an update has been made. Then you can quote yourself so that everyone subscribed to the topic is notified.

For an example of this, see:

That's what I thought, but there's no pencil on my OP.

The forum software allows edits for only so long (3 months I think), so I made the edit for you. Please advise if you would like any further changes to your OP.