Can a keyboard shortcut force TextEdit windows to close and discard all changes?
tell application &quot;TextEdit&quot; to close (windows where name of its document is &quot;Untitled&quot;) saving no would close the &quot;Untitled&quot; document without saving it, tell application &quot;TextEdit&quot; to close every document saving no would do the same for all open documents.
You could close the current window with tell application (path to frontmost application as text) to close window 1 saving no. It would close all tabs in some applications that use tabs though.
It's easier to just press ⌘W⌫ in my opinion. You can disable the animation for showing the sheets with defaults write -g NSWindowResizeTime -float 0.001.