Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.7: Scripting a fix for the loss of the Command+D shortcut' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.7: Scripting a fix for the loss of the Command+D shortcut
Authored by: Lri on Jul 22, '11 08:21:29AM

You can now use ⌘⌫ (delete / backspace) for Don't Save in Lion, see http://mattgemmell.com/2011/07/21/save-sheet-shortcuts-in-lion. ⌘D is already used an alternative shortcut for ⇧⌘D in file dialogs.

I've been using this script for a while:

try
	tell application (path to frontmost application as text)
		set a to do shell script "echo " & quoted form of (path to it as text) & " | sed 's/.*:\\(.*\\).app:/\\1/'"
		if {"TextMate"} contains a then
			close window 1
			tell application "System Events" to key code 51 using command down -- keystroke "d" in 10.6
		else
			close window 1 saving no
		end if
		if (count (windows where visible is true)) is 0 then
			tell application "System Events" to keystroke tab using option down
			-- ⌥⇥ = Move Focus to Active or Next Window
		end if
	end tell
end try


[ Reply to This | # ]