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

Changing shortuct keys in 'Services' Apps
I was reading a thread in hear talking about a problem with Services ( Mail, Grab, OmniDictionary, etc. -- Oh yeah, don't forget Quake 3 Arena [1.29f] ), namely that you can't know which Service is going to get a key if they both have it defined for a shortcut.

I ran into this problem myself today. I downloaded OmniDictionary and InstantLinks, and they both define the same two keys for the same two options ( "Lookup in Dictionary" and "Open URL" ). I prefer OminDictionary's much more featured lookup ( InstantLinks just jumps to m-w.com ), but Instant had taken over the 'Command-=' key. I tried a number of experiments to see if I could control which Service got the key. I thought perhaps the "Install" order might have something to do with it, but no cigar ...

[Editor: If you're interested in changing the keys assigned to various system services (available under the "Program menu" in the menubar), read the rest of this article for the how-to ... it's fairly easy, and definitely a handy tip!]

So I then decided to see if I could just change the key to something else. Having done some 'defaults' and .plist hacking ( not to mention messing around with Project/Interface Builder ), I figured there should be a nice, easy to spot convention for such things in Cocoa. From other tips I had read, I "Go"ed to "/System/Library/Services/" ( you don't have to have a Finder window open to use the Go command, btw. Now only if it could launch apps ... ), right-clicked on InstantLinks.service, and selected "Show Package Contents". Stepping into the Contents dir, I spotted Info.plist and dropped it on TextEdit. Now, as this was a Plist file, searching for the word "key" was going to be rather futile, so I tried searching for "=". Sure enough, an entry popped up:

[Editor's note: The angle-brackets have been replaced by square-brackets here, but they will be normal angle-brackets in the file you look at.]
[key]NSKeyEquivalent[/key]
[dict]
[key]default[/key]
[string]=[/string]
[/dict]
[key]NSMenuItem[/key]
[dict]
[key]default[/key]
[string]InstantLinks/Dictionary Lookup[/string]
[/dict]
So I ripped out this part:
[key]NSKeyEquivalent[/key]
[dict]
[key]default[/key]
[string]=[/string]
[/dict]
and saved the file. I logged out and back in, and now OmniDictionary is the only service to define 'Command-='. Of course I could have changed it to some other key, but I wanted to see if that would work. :) And since that does work, that means you can also give shortcuts to menu items that don't have them defined ...

You can also do this with apps that register themselves as Services. For example, I surfed into OmniWeb's package and looked at Info.plist. Searching for "NSKeyEquivalent" revealed OmniWeb's single menu item for Services ...

Pretty cool, ne?
    •    
  • Currently 3.50 / 5
  You rated: 4 / 5 (4 votes cast)
 
[5,634 views]  

Changing shortuct keys in 'Services' | 5 comments | Create New Account
Click here to return to the 'Changing shortuct keys in 'Services'' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Re: Changing shortcut keys in 'Services'
Authored by: Clint MacDonald on Jul 03, '01 03:10:09PM

You can also do this with apps that register themselves as Services. For example, I surfed into OmniWeb's package and looked at Info.plist. Searching for "NSKeyEquivalent" revealed OmniWeb's single menu item for Services ...

Pretty cool, ne?
Pretty cool, yeah!

I wonder, can a similar approach be applied to other sytem-wide keystrokes? I have in mind two examples, though everyone probably has his or her favorites:

(1) Can we change the Finder's "New Folder" back to "Command-n"?
(2) Can we change the program switching shortcut from "Command-tab" to, say, "option-tab"?

Best wishes,
Clint



[ Reply to This | # ]
Re: Changing shortcut keys in 'Services'
Authored by: Anonymous on Jul 04, '01 02:23:16PM

Probly not. Those are not Services.

We certainly can't change the Finder's keys, since it's a Carbon app - and no, you can't just change the fmnu resource, because it's different now. =P

Command-Tab looks to be a Dock feature, so there's some hope. But not much.

But any Cocoa app can be changed - either with .nib file hacks or some other tip that was on here a while back...



[ Reply to This | # ]
Re: Changing shortcut keys in 'Services'
Authored by: Clint MacDonald on Jul 04, '01 08:09:30PM
Probly not. Those are not Services.
Rats!
Command-Tab looks to be a Dock feature, so there's some hope. But not much.
But at least there is hope! :-) Best wishes, Clint

[ Reply to This | # ]
Changing shortuct keys in 'Services'
Authored by: Rev. Al on Nov 05, '03 01:25:05PM

I wonder if anyone has figured out how to change the shortcut key combo for the "Open URL" Service in 10.3? It doesn't appear in the Safari info.plist, any ideas where this is set?



[ Reply to This | # ]
Change shortuct for Open URL Service
Authored by: MJCube on May 25, '05 02:15:50AM

The "Open URL" Service lives in
/System/Library/CoreServices/SystemUIServer.app/Contents/Info.plist
I just re-modified mine in 10.4.1 and it works great again.



[ Reply to This | # ]