Tell me more ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Is there any way I could configure TextEdit to close the window (through keyboard shortcut) without asking me if I want to save an unsaved file?

Can be another script/program configure globally when triggered with a certain shortcut or just a script for TextEdit.

The reason for doing it is that I have a lot of temporary notes in TextEdit's window and I want to close them as fast as possible.

share|improve this question
If you have a lot of temporary files, you can try to force quit the application. It will save your open files, but won't ask you to save them. – Michiel Sep 4 '12 at 10:55

1 Answer

up vote 2 down vote accepted

tell application "TextEdit" to close (windows where name of its document is "Untitled") saving no would close all untitled documents without saving them.

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.