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

Create a universal shortcut to most apps' Preferences dialog System
After reading the hint entitled Disable Command-Q for quitting applications, I becamee inspired and started experimenting. Here is what I ended up entering in my terminal:
  defaults write NSGlobalDomain NSUserKeyEquivalents 
    '{"Quit Safari" = "@Q"; "Preferences..." = "@;";}'
[Enter that on one line, with a space before the single quote that starts the second line above.]

With this command, I disable Command-Q in safari, as per the other hint, but I also make a universal shortcut for the menu item "Preferences..." under the {insertAppNameHere} menu in all Cocoa apps and most Carbon apps. The one I used is Command-semicolon, but you can set it to almost anything. Way cool if you ask me!
    •    
  • Currently 2.20 / 5
  You rated: 3 / 5 (5 votes cast)
 
[14,934 views]  

Create a universal shortcut to most apps' Preferences dialog | 27 comments | Create New Account
Click here to return to the 'Create a universal shortcut to most apps' Preferences dialog' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Create a universal shortcut to most apps' Preferences dialog
Authored by: Kool on May 09, '03 10:49:23AM

I like this hint! I skipped the Safari thing, but I like the
Preferences shortcut being consistent now! Thnks!



[ Reply to This | # ]
Create a universal shortcut to most apps' Preferences dialog
Authored by: Kool on May 09, '03 11:09:37AM

Actually, the semicolon is already is use for 'Check Spelling' I
found out, better use the comma ","!

How to use an option key with this hint? The terminal doesn't
like it if I just type '...' (that's option-; (after Mail.app) on my
Dutch keyboard)...



[ Reply to This | # ]
Create a universal shortcut to most apps' Preferences dialog
Authored by: santin on May 09, '03 02:12:17PM

Try with "~;"

Remember:
$ -> shift
@ -> command
^ -> control
~ -> option



[ Reply to This | # ]
Create a universal shortcut to most apps' Preferences dialog
Authored by: rbest on May 09, '03 10:50:41AM

Could this be easily converted to change the system wide
'Logout...' to have the Command-Q instead of Command-Shift-
Q?
Personally I like it with the shift combo (keeps me from making
that mistake), but here at the school I work for users are use to
Command-Q to logout from Macintosh Manager.



[ Reply to This | # ]
Create a universal shortcut to most apps' Preferences dialog
Authored by: Kynn on May 09, '03 11:25:55AM

FYI,

According to the debug window link in Safari to the keyboard shortcuts, Cmd-, (command-comma) is the preferred shortcut for preferences. It includes the note "new MacOS X standard; now in HI Guidelines".

--Kynn

---
--
http://www.maccessibility.com/

[ Reply to This | # ]

Create a universal shortcut to most apps' Preferences dialog
Authored by: GaelicWizard on May 09, '03 12:47:10PM

Appearently CMD-, is the way to go! i think i'll switch to that to test it out. :-D
JP

---
Pell



[ Reply to This | # ]
Create a universal shortcut to most apps' Preferences dialog
Authored by: englabenny on May 09, '03 08:18:00PM

This feature, to be able to change shortcuts in Prefs is sadly not nearly as good as I could've been. It works, yes, but only if the menu item name is "Preferences..." exactly; Most of my apps are localized to swedish however, thus the shortcuts corresponding to "Inställningar..." is left unchanged.
Even worse, using defaults write to write accented chars like ä in "Inställningar..." does not seem to work.. :( This is a cool feature, but it needs work.



[ Reply to This | # ]
Found a Fix
Authored by: englabenny on May 10, '03 06:03:11AM

I used a donationware from ittpoi called Rekey to do this, it worked great, even with swedish characters.

www.ittpoi.com



[ Reply to This | # ]
Found a Fix
Authored by: bluehz on May 10, '03 11:52:29AM

Thx - I have tried Rekey before - and while it seems that it should do the trick - it crashes on me 95% of the time. Don't think its fully baked yet. Great idea though - but should be built into System anyway.



[ Reply to This | # ]
Here's how to do non-ASCII chars…
Authored by: carsten on May 10, '03 12:39:49PM

From the Terminal, characters must be entered in unicode hex:

  • "ä" = "\U00e4"
  • "…" = "\U2026"

Use the Character Pallette in the Keyboard menu to look up the hex Unicode values.


defaults write NSGlobalDomain NSUserKeyEquivalents '{"Inst\U00e4llningar..." = "@,"; }'

Once you have done this, log out and back in to see the changes written into the file:

  • ~/Library/Preferences/.GlobalPreferences.plist

The file is encoded with UTF-8. Open it with Project Builder. Choose the "Format" menu, then "File Encodings", "Unicode? (UTF-8)" then click Reinterpret. Once opened this way, the Project Builder window will update to show any changes you make in the Terminal.

(Of course at this point you can just continue to edit the key commands in Project Builder rather than using the terminal).

[ Reply to This | # ]

Create a universal shortcut to most apps' Preferences dialog
Authored by: Cantus on May 09, '03 09:55:05PM
Of course you could just use Menu Master from Unsanity. But it's $10.

Talk about starving developers.

[ Reply to This | # ]

Create a universal shortcut to most apps' Preferences dialog
Authored by: bluehz on May 09, '03 10:01:36PM

Neither of the techniques mention how to reset it back to the
default if you don't like it... or is that obvious and I am missing
it....



[ Reply to This | # ]
Removing a key equivalent
Authored by: Cameroon on May 10, '03 10:34:19AM

You can delete the whole NSUserKeyEquivalents entry with

defaults delete NSGlobalDomain NSUserKeyEquivalents

You can modify or add key equivalents with -dict-add:

defaults write NSGlobalDomain NSUserKeyEquivalents -dict-add "Quit Safari" ""

The affect of the above is to set "Quit Safari" to use the normal key equivalent and is as close as you can get with the defaults command line utility to removing a specific NSUserKeyEquivalents without re-doing the whole thing.

Oh, and it would probably be useful to point out that defaults read NSGlobalDomain NSUserKeyEquivalents will show you what global key equivalents you have.

Also note: I don't know if the defaults command in 10.1 supports the -dict-add syntax, but it probably does.

You should also be able to use Property List Editor to edit the file where the global domain is stored, you just have to find the file first.



[ Reply to This | # ]
Create a universal shortcut to most apps' Preferences dialog
Authored by: Cameroon on May 10, '03 10:46:57AM

I believe the poster was referring to getting the ellipses
character that is used for, say, "Preferences..." If you type
option-; in the terminal it doesn't understand and adds a useless
"key equivalent" into the defaults.

Needless to say, "Preferences~;" is not the way to get the right
character ;) I believe the @,$,~,^ only affect the key
equivalent and do nothing for the name of the key equivalent.

So, yes, how does one get the proper "..." character entered via
the terminal?



[ Reply to This | # ]
Bah - hit the wrong link
Authored by: Cameroon on May 10, '03 10:48:35AM

Sorry, this above post was meant for the question about getting
the "..." character.



[ Reply to This | # ]
. . .
Authored by: carsten on May 10, '03 12:22:48PM

You must enter three periods instead of the actual ellipsis character for this trick to work, at leat this is true for me with "TextEdit".



[ Reply to This | # ]
*sigh* -- But to answer the question
Authored by: Cameroon on May 10, '03 10:50:47AM

It appears that using three periods (literally typing ...) works.
*shrug* it didn't last night when I tried it, but TextEdit seemed
to pick it up just fine today.



[ Reply to This | # ]
Don't forget to log out/in afterwards
Authored by: huzzam on May 10, '03 03:03:07PM

Ahh, that's the trick, forgot to log out/in, & couldn't figure out why it wasn't working. BTW, perhaps y'all would also like:

defaults write NSGlobalDomain NSUserKeyEquivalents \
'{"Hide Others" = "@~h";}'

to get consistent apple-opt-H hiding of other apps...



[ Reply to This | # ]
Create a universal shortcut to most apps' Preferences dialog
Authored by: rodik on May 11, '03 10:35:30AM

I must be really stupid. After trying this out I decided that I don't like it all that much, but I can't figure get get the keys back the way they were. Could anyone hint me on how to do just that?



[ Reply to This | # ]
Create a universal shortcut to most apps' Preferences dialog
Authored by: machine on May 11, '03 01:39:05PM

Here's how to get rid of the above changes. This deletes what you just wrote in the "NSUserKeyEquivalents" key:

To delete:
defaults delete NSGlobalDomain NSUserKeyEquivalents

To see what it is set to:
defaults read NSGlobalDomain NSUserKeyEquivalents



[ Reply to This | # ]
So close!
Authored by: lipbone on May 11, '03 06:07:22PM

This only encourages me to think that there must be a simple way to change the "Command-Option-D" setting for "Turn Hiding On" under the Apple Menu. Any thoughts???



[ Reply to This | # ]
How about setting apple-H to hide photoshop?
Authored by: Kristo on May 12, '03 03:04:14PM
Adobe apps are the only apps I know where apple-H doesn't hide the program. It would be nice to be able to set apple-H to hide Photoshop. It wouldn't work just to edit the code posted above. I tried this:
defaults write NSGlobalDomain NSUserKeyEquivalents '{"Hide Photoshop" = "@H";}'


[ Reply to This | # ]
How about setting apple-H to hide photoshop?
Authored by: Kristo on May 15, '03 09:04:03AM

found the file: photoshop>presets>photoshop actions>commands.atn

thought that file could be edited to modify the key-commands in photoshop, but I can't get it opened properly (BBEdit showed just a bunch of rectangles).

Help? anyone?



[ Reply to This | # ]
How about setting apple-H to hide photoshop?
Authored by: GaelicWizard on Aug 30, '03 05:34:40PM

i'm not too sure, but @H might mean CMD-shift-h not CMD-h like you intended, iThink its sensitive to h or H. does that make any sense?

---
Pell



[ Reply to This | # ]
How about setting apple-H to hide photoshop?
Authored by: elmimmo on Aug 31, '03 06:49:20PM

In Preferences/general tick "Use system shortcuts". From then on command-h will hide PS, while Option+Command+H will hide canvas aids.



[ Reply to This | # ]
Create a universal shortcut to most apps' Preferences dialog
Authored by: GaelicWizard on Aug 29, '03 11:15:55PM
Howdy, y'all! I've done a little further experimentation and I thought I'd add this for any who want this to work universally. This hint works for all applications that have their preferences menu option as "Preferences" followed by three periods, like most cocoa apps (so far as i know). other apps (like most carbon apps, go figure) have "Preferences" followed by an elipse (iThink that's how its spelled...). unfortunately you can't type that in the terminal, so this hint doens't work for it exactly.

To make it work in all (as far as I can tell!) apps, you must open ~/Library/Preferences/.GlobalPreferences.plist in the property list editor (or a text editor, but I don't feel comfortable doing it that way, too easy to mess up). Scroll down, and expand as neccessary to find the NSUserKeyEquivalents entry. Duplicate the entry (under NSUserKeyEquivalents) for "Preferences" followed by the three periods and change the deplicate to be "Preferences" followed by an elipse. save it and woohoo! This way both kinds of apps work with the new key equivelant!

to check if it works in terminal type
defaults read NSGlobalDomain NSUserKeyEquivalents
and you should see
{"Preferences..." = "@,"; "Preferences\U2026" = "@,"; }
or similar (note the "\U2026" that's the elipse.)
I've not had good experiences with escaping characters in the terminal, so I won't recommend trying to enter the elipse that way, if you can make it work, then bravo to you! :-D

---
Pell

[ Reply to This | # ]

Create a universal shortcut to most apps' Preferences dialog
Authored by: GaelicWizard on Aug 30, '03 05:31:01PM

ok, there's supposed to be *TWO* back-slashes! in the thingie there, damn geeklog...

---
Pell



[ Reply to This | # ]