Skip navigation Bottom Menu ↓ Menu ↑

The Mac OS X trick of the week! (or day?) (Read 3071 times)

0 Members and 1 Guest are viewing this topic.

  • actionjacob

  • Guest
The Mac OS X trick of the week! (or day?)
OP: January 23, 2008, 03:35:58 PM Last Edit: January 28, 2008, 10:28:01 PM by actionjacob
Hi gents,

This morning I had the idea of creating a sticky topic to post cool tips and tricks on Mac OS X. The problem is that I don't know how often I will be able to post, and I don't know when I will run out of tricks. For now, I believe I will be able to post something every 2-3 days.

Also, the topic is open so you can post comments and questions about tricks, but please don't over flood it. If it's flooded by random comments then people will not be able to find the tricks thus defeating the purpose of this thread.

Before we get started, be aware that even though most of these tricks are either hidden or not shipped of the box, these are all simple tricks that can be easily undone. Meaning that if you are concerned about your warranty or making your system unstable, feel safe because worst comes to worst, you can easily undo any change these tricks do.

Thanks! And now, it is time for the:

Trick #001 - Dragging widgets out of Dashboard!

In Terminal:
Code: [Select]
defaults write com.apple.dashboard devmode YES
killall Dock

This allows you to drag widgets out of Dashboard onto the desktop. It requires the dock to be relaunched to take effect, which explains the "killall dock" command. Now, if you click and hold onto a widget in the dashboard and then return to the desktop, the selected widget will not disappear with the rest. This is particulary useful for stuff such as the calculator and the metric converter when working on something. Or, it also allows you to have your note widget on the desktop at all time (because we all know that sticky note is an ugly application). To reverse, simply put NO at the end of the first line of code.

Have fun!

  • ****
  • Mittens eats well tonight.
  • Spruce
  • Posts: 1138
    • Male
Re: The Mac OS X trick of the week! (or day?)
Reply #1: January 23, 2008, 04:53:31 PM Last Edit: January 23, 2008, 08:36:59 PM by actionjacob
Hey, cool. I didn't know about that one. I don't use Dashboard much, but I may have to start.

Can I play?

Trick #002 - iTunes Store Arrows

You know those little arrows in iTunes that let you hop over to the iTunes store and spend your money on an artist or album with a minimum of fuss? Well, they have a far more useful function that you can exploit.

First, if the arrows are hidden, you can show them by going to iTunes > Preferences > General tab and checking "Show links to iTunes Store".

That done, try option+clicking on an arrow. It takes you to that song/artist/album in your library, rather than in the store. Cool! But doesn't it get annoying holding down the option key all the time?

Yes. Yes it does.

You can reverse this behaviour so a click will take you to the library and option+clicking will send you to the music store by typing the following command in Terminal:

Code: [Select]
defaults write com.apple.iTunes invertStoreLinks -bool YES
Then restart iTunes and you're good to go. If you want to reverse the change, you can do so with the same command but with the YES changed to a NO.

  • actionjacob

  • Guest
Re: The Mac OS X trick of the week! (or day?)
Bastard! I was going to post that next week!

  • ****
  • Mittens eats well tonight.
  • Spruce
  • Posts: 1138
    • Male
Re: The Mac OS X trick of the week! (or day?)
:D

I've got a bunch more, but I'll wait until... well, I'll wait until you post another one. Wouldn't do to go swamping the thread, now. :)

  • actionjacob

  • Guest
Re: The Mac OS X trick of the week! (or day?)
Ooooo now's the time for a new trick. I can hardly wait to see what Geekman is going to post wait.

Trick #003 - Makes hidden applications' dock icons translucent!

In Terminal:
Code: [Select]
defaults write com.apple.Dock showhidden -bool YES
killall Dock

As the name says, this will make hidden application's dock icon translucent. Simply launch an application, right click and select "Hide" and watch the icon becoming translucent. To disable, simply put NO at the end of the first line of code.

  • ****
  • Mittens eats well tonight.
  • Spruce
  • Posts: 1138
    • Male
Re: The Mac OS X trick of the week! (or day?)
Reply #5: January 28, 2008, 02:46:51 PM Last Edit: February 29, 2008, 10:18:51 AM by actionjacob
I hate to break tradition and move away from Terminal hacks, but:

Trick #004 - Switching Applications

Okay, we all know about Exposé (right?) so there's no need to go over that ground - but sometimes it's nice not to have to reach over to that mouse to do the switching. However, there is another way.

Just like the Alt+Tab command in Windows, you can hit Command+Tab on a Mac. The difference between the two is that while Alt+Tab displays all open windows, Command+Tab displays all open applications, whether or not they have windows open, and with only one icon for each application even if they have multiple windows. And it's prettier. Pressing Tab repeatedly while holding Command will allow you to move through the list, and Command+Shift+Tab moves backwards.

You can switch between application windows by pressing Command+` (lowercase ~).

That's not all. The best part - you can quit applications selected in the Command+Tab menu by pressing the Q key, and you will not leave the menu. That makes it a great way to quit multiple applications at once. (Please note that, on pre-Leopard operating systems, the Q key is recognized to be in its QWERTY position regardless of your keyboard layout. This is fixed in Leopard.)

Re: The Mac OS X trick of the week! (or day?)
where is the next tip of the week??

  • ****
  • Mittens eats well tonight.
  • Spruce
  • Posts: 1138
    • Male
Re: The Mac OS X trick of the week! (or day?)
I've been waiting for Jacob to post something... I can't be seen making two consecutive tips of the week!

  • actionjacob

  • Guest
Re: The Mac OS X trick of the week! (or day?)
Reply #8: February 28, 2008, 05:51:23 PM Last Edit: February 29, 2008, 01:12:23 PM by actionjacob
Sorry, I got really busy with mid-terms and stuff. Anyway, here is it!

Trick #005 - Quitting and Relaunching Applications

You probably all know about Ctrl+Alt+Del on Windows. Not the online comic, but the little window that opens and allows you to quit applications that are not responding. Well, Mac OS X comes with the same thing, except it's a different command. Simply press Option+Command+Esc and a small window will appear showing all currently open applications and giving you the option to either force quit them or relaunch them depending on if they are responding or not. Pretty Handy.


  • ****
  • Mittens eats well tonight.
  • Spruce
  • Posts: 1138
    • Male
Re: The Mac OS X trick of the week! (or day?)
Reply #9: February 29, 2008, 03:28:47 AM Last Edit: February 29, 2008, 10:19:21 AM by actionjacob
Trick #006 - Screenshots

You can take a screenshot (an image of your screen) by pressing Command+Shift+3. An image of your full screen will appear on your desktop in PNG format, or in PDF in the case of Panther (10.3) or before.

You can also take a picture of a particular area of the screen by pressing Command+Shift+4. Your mouse cursor will change to a crosshair; click and drag to select an area that you wish to take a picture of. When you release the mouse button, that picture will appear on your desktop as above.

You can also get a particular window by pressing the spacebar while the Command+Shift+4 crosshair is showing. The cursor will change to a camera, and clicking on a window (it will highlight when you mouse over it) will give you a picture of just that window. You'll get a shot of the full window, even if it is partially hidden by another - and in Leopard (10.5) you will even get the drop shadow as well! Press the spacebar again while the camera is showing to cycle back to the crosshair.

  • actionjacob

  • Guest
Re: The Mac OS X trick of the week! (or day?)
Reply #10: February 29, 2008, 01:10:11 PM Last Edit: February 29, 2008, 01:44:43 PM by actionjacob
Trick #007 - Move files to the trash using rm in Terminal

If you don't use Terminal, you might want to forget about this trick, but for those of you who like to run commands in Terminal, how many times have you accidently removed a file in Terminal using the command rm and then realized you still needed that file? Here's the point of today's trick. This little script will affect the rm command in Terminal by moving everything to the Trash instead of permanently deleting it.

First of all, you'll need to edit a bash file that runs every time you open Terminal. Open a new Terminal window and type:
Code: [Select]
nano ~/.bash_profile
This will open the file .bash_profile which is a file containing bash scripts that are run every time you open a new Terminal. The file might already be there with lines of code in it. If the file doesn't exist, no problem, it will just be created. Navigate to the end of the file using the arrows on the keyboard and add:
Code: [Select]
# rm to trash function
function rm () {
  local path
  for path in "$@"; do
    # ignore any arguments
    if [[ "$path" = -* ]]; then :
    else
      local dst=${path##*/}
      # append the time if necessary
      while [ -e ~/.Trash/"$dst" ]; do
        dst="$dst "$(date +%H-%M-%S)
      done
      mv "$path" ~/.Trash/"$dst"
    fi
  done
}

Now simply close the file by pressing Ctrl+X. When prompted to saved the file enter Y and press enter. Exit all Terminal application and that's it! Next time you open a Terminal window and use the rm command, the file(s) will be moved to the Trash instead of being deleted.

To test the script, open a new Terminal window and type:
Code: [Select]
touch test
rm test

This example will create a file called test using the command touch. It will then move the file to the Trash using the command rm. Now look in your Trash and you should see test somewhere in there.

And the beauty is that it also works with options. For example rm +r will recursively move a folder in the Trash. Magic!


  • ****
  • Mittens eats well tonight.
  • Spruce
  • Posts: 1138
    • Male
Re: The Mac OS X trick of the week! (or day?)
Reply #11: February 29, 2008, 04:46:16 PM Last Edit: February 29, 2008, 04:48:36 PM by Geekman
Ooo! A trick I didn't know about, and a very handy one at that.

Hmmm... what can I come up with...

Trick #008 - Controlling Other Computers

If you have a couple of Macs at home, maybe a laptop and a desktop, it's annoying to have to keep switching between them as necessary. I don't have a very big desk, so I keep my iBook on the floor and my iMac on my desk, and I don't like lying on my stomach too much. So I'm going to tell you three tricks for controlling one computer from the other.

To keep things simple, I'm going to use my iMac to control my iBook in this example, so the iMac will be set up as the controlling computer and the iBook as the controlled.


Method One
If both computers are using Leopard (10.5), you can control one very simply if both are on the same network. On my iMac, I would activate Finder, and go to Go => Network or press Command+Shift+K. I should see my iBook listed there, and I can simply double-click on it and click the "Share Screen..." button. On my iBook, I will have to confirm that I want to allow my screen to be shared, and then I'll be able to control everything on the iBook from my iMac.

Could somebody verify this? My iBook is out of commission at the moment, and it only runs Tiger, so I'm going on a couple of assumptions here.


Method Two
Versions of Mac OS X prior to Leopard don't support that sort of screen sharing, so you have to go about it a little differently. These instructions will work if one or both of the computers are running earlier versions of OS X. It doesn't matter which one. With a little adaptation, it will also work if the computer that is trying to share the iBook's screen is running Windows or Linux.

On the iBook, I would open System Preferences ( => System Preferences...) and click Sharing under Internet & Network. I check the Screen Sharing box, then click Computer Settings and check "VNC viewers may control my screen with password:". I enter a password, then click OK and quit System Preferences.

On the iMac, I use a third-party app known as a VNC client in order to connect to the iBook. The one I use is JollysFastVNC, although you can certainly adapt the instructions to suit another client if you prefer. I open JollysFastVNC on my iMac, and see that my iBook is listed. It's not the newest computer, so I call it Methuselah. It is automatically detected and listed as "methuselah.local.:5900". I just have to click Connect, enter my password, and an image of the iBook's screen pops up. I can share over the internet as well, but the instructions are a little more complicated and I won't go over them here.


Method Three
This method is only for more advanced users comfortable in the UNIX command line.

On my iBook, I open System Preferences, go to the Sharing pane, and check Remote Login.

On my iMac, I just have to open Terminal and type:

ssh geeks@methuselah.local

Where geeks is my username on the iBook and methuselah.local is the name of my iBook. I'll be prompted for a password, so I enter the password of the account on the iBook. After a brief pause, I'll be given another command line, but this one is controlling my iBook, not my iMac. I can type all my commands just like I was inputting them directly in Terminal on the iBook. When I'm done, I'll just type logout and I'll be back at my iMac's command line.



Note: I refer to the name of my iBook (methuselah.local) a couple of times here. This name can be seen and changed at the top of the Sharing preference pane.

  • ****
  • Mittens eats well tonight.
  • Spruce
  • Posts: 1138
    • Male
Re: The Mac OS X trick of the week! (or day?)
You can switch between application windows by pressing Command+` (lowercase ~).

;)

  • ****
  • Shrubbery
  • Posts: 260
Re: The Mac OS X trick of the week! (or day?)
A nice 'trick' I have found with Leopard and parallels is this;

Start up your Windows VM (I use my bootcamp partition).

Create at least another desktop with 'Spaces'.

Shift your VM over to the opposite desktop - then switch into full screen.

"Pause" the VM using the pause option from the 'action' menu.

Now you can switch between full-screen OS X and Windows using your spaces hotkey (alt+cursor keys by default).

*As the VM is paused when not in use, it uses up only 1 or 2% of your CPU.


This^ works best when you have plenty of Ram (I use 4GB - 1GB for the VM, and 3GB for OS X).


  • ****
  • Mittens eats well tonight.
  • Spruce
  • Posts: 1138
    • Male
Re: The Mac OS X trick of the week! (or day?)
Reply #14: March 03, 2008, 02:43:46 AM Last Edit: April 17, 2008, 10:27:54 PM by Geekman
(I use 4GB - 1GB for the VM, and 3GB for OS X).

*envy*


Edit: Okay, since this thread is apparently dead, I'll throw in another tip.

Trick #009 - Drilling Through Directories

This is a trick I've never heard publicized anywhere, but if you right-click on the title of a Finder or Safari window, you'll get a menu with all parent directories listed. You can click one and voilà!

A small trick, but cool nonetheless.