Wednesday, 6 September 2017

osx snow leopard - Is it possible to remove a built-in shortcut from an application in Mac OS X?


Long story short, I want to use Cmd-Shift-S for "Save As" in TexMaker, my favorite OS X LaTeX editor.


But Cmd-Shift-S, the standard "Save as" shortcut, is already taken by some worthless formatting shortcut.


Oddly enough TexMaker doesn't call the menu item "Save As..." either, but just "Save As." So I can go into System Prefs -> Keyboard -> Keyboard Shortcuts -> Application Shortcuts, select TexMaker, type "Save As," and set Cmd-Shift-S as the shortcut, and it shows up in the application's menu, but there's this other formatting shortcut that it recognizes as Cmd-Shift-S too.


So I'm wondering if it's possible to remove its built-in Cmd-Shift-S and replace it with the one I want. OS X 10.6.



Answer



You have two options:




  • Set the worthless formatting menu item's shortcut to something difficult to press instead, thereby freeing CmdShiftS.




  • Run the following in Terminal to remove the shortcut from the menu item labeled Worthless Formatting Shortcut:


    defaults write com.vendor.yourapp NSUserKeyEquivalents -dict-add "Worthless Formatting Shortcut" nil


It doesn't work in all applications (prominent example: Microsoft Office), but it should work in all well-behaved Cocoa applications.


To find out what your application uses for com.vendor.yourapp, right-click the application bundle, select Show Package Contents, navigate to Contents, open Info.plist using a text editor, or better a property list editor like Property List Editor or Xcode 4 (both part of Apple's developer tools) and look for CFBundleIdentifier or the like.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...