MacOS – How to remap the “Send tweet” hotkey

macosnotificationssharingtwitter

In Mountain Lion there is a "tweet sheet" when sharing from either notification center or an app. The default hotkey for "send tweet" is CMDShiftD. I'd like to use something like CMDRETURN. Is there a way to remap this?

Best Answer

You can use Spark to set custom keybindings for nearly anything in OS X. You can set up a shortcut to execute an AppleScript and use the following script:

display dialog "Tweet?" default answer "" buttons {"OK"} default button 1
set mytweet to text returned of result

tell application "System Events"
    tell process "Notification Center"
        click menu bar item 1 of menu bar 1
        click button 1 of UI element 1 of row 2 of table 1 of scroll area 1 of window "window"
        keystroke mytweet
        keystroke "D" using {command down, shift down}
        keystroke space
    end tell
end tell

Source: TUAW