4

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.

1

1 Answer 1

2

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.

8
  • Tried both. The replacement shortcut showed up in the menu in the app. Rather, to speak concretely, the worthless formatting menu item = "\textsl - Slanted [selection]" and now it is listed as having shortcut opt-shift-cmd-s. Similarly, shift-cmd-S is correctly listed as shortcut for "Save As." Furthermore, if there is no focus in a text editor, shift-cmd-S works for Save As. But if the focus is in the text editor, shift-cmd-S still does the dumb slanting shortcut instead of Save As.
    – Philip
    Commented May 24, 2011 at 15:34
  • I also tried the terminal trick, but got "Could not parse: \textsl - Slanted [selection]. Try single-quoting it."; same message even when I tried single quoting or double backslashing. Could it be that I misidentified the bundle? The BundleIdentifier was just "texmaker"; I tried both com.texmaker and com.texmaker.texmaker in the terminal command. Thanks!
    – Philip
    Commented May 24, 2011 at 15:36
  • @Philip Since Texmaker is cross-platform, and neither looks nor behaves like a normal Mac OS X application, I am afraid it's not one of the well-behaved Cocoa applications whose menu item shortcuts can be changed. At all. It seems they hard-code things in a way that cannot be changed by Mac OS X methods... While I usually make sure my answers work, I don't always download and install all applications they refer to. Sorry about that.
    – Daniel Beck
    Commented May 24, 2011 at 16:52
  • No problem; that makes sense, and you've been more than helpful and I have no expectation that you'd go to that trouble! So are you saying though, the typical methods to do this won't work? Or are you saying, based on how Texmaker was coded, that nothing will work? If the latter, I will accept your answer so the question can be closed. Thanks!
    – Philip
    Commented May 25, 2011 at 3:51
  • @Philip You need to contact the developers of TexMaker. I assume they primarily develop for other platforms, so they might not even be aware of this issue. The described method is how you usually do this for Mac OS X applications. Some, e.g. MS Office, are programmed in a way so this doesn't work, but they often provide their own menu customization methods. If they don't, you're pretty much out of luck. I doubt that the developers can somehow configure their GUI toolkit so this method works again. They'd need to provide their own methods of configuration. At least, all platforms would profit.
    – Daniel Beck
    Commented May 25, 2011 at 6:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .