OSX

From Robertjd

Jump to: navigation, search

Contents

[hide]

Screen Capture Shortcuts

Entire screen to file on desktop:

Command-Shift-3

Entire screen to clipboard

Command-Control-Shift-3

Manually select with a crosshair:

Command-Shift-4

Select a specific window:

Command-Shift-4 and then Spacebar

http://graphicssoft.about.com/od/screencapturemac/ht/macscreenshot.htm

Terminal Key Actions

Use these key actions in Terminal keyboard preferences to get forward delete, home, and end key behavior:

Delete: \004 (via Control-Option-d)

Home: \001 (via Control-a)

End: \005 (via Control-e)

Some pages I used to figure this one out:

http://blog.nominet.org.uk/tech/2006/05/10/make-home-and-end-work-in-mac-os-x-terminal/

http://www.macosxhints.com/article.php?story=20050525040921189

Home/End keys to beginning/end of the line

To get home/end key behavior to place the cursor at the beginning and end of the lines you will need to create a default key binding file if it does not already exist.

Create this folder if it does not exist:

mkdir ~/Library/KeyBindings

Now create the default key binding file and open it with TextEdit

touch ~/Library/KeyBindings/DefaultKeyBinding.dict
open -a TextEdit ~/Library/KeyBindings/DefaultKeyBinding.dict

Paste the following into that file:

{
   /* home */
   "\UF729"  = "moveToBeginningOfLine:";
   "$\UF729" = "moveToBeginningOfLineAndModifySelection:";

   /* end */
   "\UF72B"  = "moveToEndOfLine:";
   "$\UF72B" = "moveToEndOfLineAndModifySelection:";

   /* page up/down */
   "\UF72C"  = "pageUp:";
   "\UF72D"  = "pageDown:";
}

Save the file and restart any Cocoa applications. Note: This only works for Cocoa applications

See this article on the TextMate blog for a more thorough explanation of the above procedure:

http://blog.macromates.com/2005/key-bindings-for-switchers/

Home/End keys in Firefox

The above procedure does not work for Firefox because it is not a Cocoa application. There a many "quick fix" programs on the internet that will fix this problem for you. Just do a Google search for "firefox home end":

http://www.google.com/search?client=safari&rls=en&q=firefox+home+end&ie=UTF-8&oe=UTF-8

I'm not going to try to keep up with all those programs because they are changing all the time. What I will do here is spell out a manual way of getting into the guts of Firefox and changing this yourself.

Caution: Use this procedure at your own risk. The file I will be telling you to use has not been updated since 2007. While it seems to work fine with Firefox 3, I cannot guarantee anything.

First, download this file:

http://bloodnok.net/MacOS/platformHTMLBindings.xml

It has all kinds of key binding goodness that you expect from a user interface.

You will need to un-jar a file within the Firefox application bundle, replace a file, create a new jar file, and then place that new jar file into the Firefox application bundle. Here is the terminal procedure with an explanation afterwards:

mkdir /tmp/firefox-jar
cd /tmp/firefox-jar/
jar -xvf /Applications/Firefox.app/Contents/MacOS/chrome/toolkit.jar
cp ~/Downloads/platformHTMLBindings.xml /tmp/firefox-jar/content/global/platformHTMLBindings.xml
mv /Applications/Firefox.app/Contents/MacOS/chrome/toolkit.jar /Applications/Firefox.app/Contents/MacOS/chrome/toolkit.jar.bak
jar cvf toolkit.jar content/
mv /tmp/firefox-jar/toolkit.jar /Applications/Firefox.app/Contents/MacOS/chrome/

Here is the explanation of what is going on with those terminal commands:

1.) Create a folder for us to work in, created at /tmp/firefox-jar

2.) Change our working directory to that directory

3.) Un-jar the toolkit.jar file from the Firefox application bundle into our working directory

4.) Copy our downloaded platformHTMLBindings.xml to the jar file contents, replacing the one that is there

5.) Move the current toolkit.jar in the Firefox application bundle to a backup copy

6.) Create a new jar file, which will include our replaced copy of platformHTMLBindings.xml

7.) Move the new jar file into the Firefox application bundle.

Restart Firefox and Enjoy!

Personal tools