Windows PC style Minimize All Windows and Show Desktop on Mac OS X

UPDATE April 9, 2012
I have compiled the Apple Script below (March 23, 2012 update) into an app, so you can download it and put it in your Applications folder and use it whenever you need it. There is also a Quick Launch app, which will add a little icon menulet in the top right menu bar, so you can quickly click on it to Show Desktop whenever you want:
DOWNLOAD HERE

In order for the Quick Launch app to work, you need to place both apps in your Applications folder. You can also add the Quick Launch app to “System Preferences > Users and Groups > Login Items” if you want it to start automatically when you turn on your computer.

UPDATE March 23, 2012
Ok, so now I have found and even better solution, which is back to an AppleScript, but works even better than the ShowDesktop app below!

Go here an scroll down to the answer by Daniel Beck:
http://www.superuser.com/questions/36504/minimize-all-in-mac-os/403099

Open automator and choose new application and then drag Run AppleScript from the left side to the right side and add the following AppleScript then save it as an application… that’s it!

tell application "Finder" to activate
 tell application "System Events"
  tell application process "Finder"
   tell menu bar 1
    click menu item "Hide Others" of menu of menu bar item "Finder"
    click menu item "Minimize All" of menu of menu bar item "Window"
   end tell
  end tell
 end tell


==============================
Everything below is no longer necessary.

==============================

UPDATE March 20, 2012
Ok, I finally found somebody who has figured out how to do this correctly with instantaneous showing of desktop just like on Windows … they are genius!! Check out Everyday Software for their Show Desktop product and send them a $5 donation because it’s worth it!

http://www.everydaysoftware.net/showdesktop/index.html
UPDATED: January 3, 2011
New and improved script that will start closing windows in all applications simultaneously.

Having used Windows XP for 10+ years, I always had a little Show Desktop icon down in the bottom left in the quick launch bar (keyboard shortcut is WindowsKey+D and WindowsKey+M also works). Clicking it would instantly minimize all my open windows, and reveal my desktop underneath.

Mac OS X Lion does not have an exact duplicate of this feature. It does have F11 and the 4-finger up-swipe, but these sort move the windows to the side and you can see them around the edges. The Command+Option+ClickOnEmptySpotOnDesktop I think works ok, except it requires you to hold down Command key and the Option key and then you need to find an exposed piece of the desktop to click on.

So here is my best effort… it’s an AppleScript that will finds all the open windows and minimizes them. This would be perfect except that it takes a few seconds for it actually do it as you watch each window disappear one by one. If anybody has a solution to make this faster, let me know!

So first we will open up Automator (it’s in your Launchpad) and choose new Application. Then under Actions, you will drag the Run AppleScript action over to the right side of the screen. You will then copy an paste the AppleScript below, and save your application. You can put it anywhere you want, and then drag it to your Apple Dock so it’s available to click whenever you want.

Here is the new and improved AppleScript:

--Thanks to DJ Bazzie Wazzie on MacScripter.net forum
-- http://www.macscripter.net/viewtopic.php?pid=147285

set blackList to {} –The processes in this list will be skipped. Example: “com.apple.Finder”, “Finder”

–NOTE: This section will start minimizing windows of each application at the same time.
tell application “System Events” to set processList to (bundle identifier of every process whose visible is true) as list
repeat with processName in processList
–display dialog processName –DEBUG only
if contents of processName is not in blackList then
tell application id processName
ignoring application responses
set miniaturized of (every window whose ((miniaturizable is true) and (miniaturized is false) and (visible is true))) to true
end ignoring
end tell
end if
end repeat

–NOTE: This section is required in case there are applications (like Finder, Automator, Calculator) that will not minimize using the Application ID method above
tell application “System Events”
repeat with appProc in (every application process whose visible is true) — Get all the available applications that are visible
–display dialog (get name of appProc) –DEBUG only
if (get name of appProc) is not in blackList then
click (first button of every window of appProc whose role description is “minimize button”) — From the available applications above, click on the minimize button of every window that has a minimize button
end if
end repeat
end tell

Here is the OLD script .. do NOT use this one:

−−This is the OLD script .. don't use this one!!
tell application"System Events"
−−Get all the available applications that are visible
repeat with appProc in (every application process whose visible is true)
−−From the available applications above, click on the minimize
−− button of every window that has a minimize button
click (first button of every window of appProc whose role description is "minimize button")
end repeat
end tell

Let me know what you think!

PC style Windows Keyboard shortcuts on Mac OS X

When I switched over to Mac, I very quickly realized that my Windows keyboard shortcuts no longer worked, and that they had all been “moved” on me! And seeing as I have a copy of Windows XP running in a virtual machine on my MacBook, I really did not want to try and remember two different shortcut keys, depending on whether I was using Windows or OS X.

The solution? A free program called KeyRemap4MacBook which allows you to redirect keyboard and mouse input.

My favorite keyboard shortcuts I have remapped are:
Undo=Ctrl+Z, Cut=Ctrl+X, Copy=Ctrl+C, Paste=Ctrl+V, Find=Ctrl+F, Find-Next=F3, Rename=F2, Select-Multiple=Ctrl+LeftClick

I also remapped the following a few other things to make my life easier:
For external keyboard, I setup the Home/End keys so they work properly.
For the built-in keyboard, I setup the Right Command key to be a Home key and the Right Option key to be an End key.

KeyRemap4MacBook is fairly easy to customize if you have a little bit of programming knowledge. Some of the remaps were already built-in to KeyRemap4, and some I had to customize. You can download a copy of my customize private.xml which contains all of my additions. You will to unzip it after download:

private.xml.zip

PC style Windows Taskbar on Mac OS X

One of the first things I missed when I switched from Windows to Mac, was the Taskbar along the bottom that shows all my currently open windows. There is nothing wrong with Mac’s Dock, it’s just different and is not a Taskbar. After much searching, I finally found a program that I can use to setup and simulate a Windows Taskbar along the bottom of my Mac OS X (Lion v10.7.2) screen.

The program is called DragThing. The only downside is that it costs $29 but has a free 30-day trial so you can test it out to see if it’s what you want. But without finding anything else that came even remotely close, I am ok paying the money. Here’s a screen shot:

Windows Taskbar on MacOSX

Windows Taskbar on MacOSX

First thing you need to do is move your Apple Dock to the bottom of the screen and disable Automatically Show And Hide The Dock. If you keep the setting enabled so that the dock automatically hides, then whenever you maximize a window it will go right to the bottom of your screen and cover your taskbar. If the Apple Dock is always visible, then it protects the bottom part of the screen from a maximized window.

If you want to move the Apple Dock over to the right hand side, then open up the Terminal app and type
defaults write com.apple.dock pinning end

Press Enter and then type:
killall Dock
followed by Enter again (the D in Dock must be a capital D or it will not work).

Now download and install DragThing and from the main preferences menu, click on Docks and enable the Window Dock. You will need to rotate the view of this dock, and then under it’s dock options, set Float Dock Window to Always, Show Window Title Bar At Left, Icon Size to 16×16, Spacing to 0, Width to about 70, Show Item Names At Right, and Use Single-Click To Open Items.

You can now resize it so it is only 1 item high, and then drag it down towards the bottom left of your screen. Hold down the shift key before you release the mouse button so it remembers where it is, and then under dock options disable the Show Window Title Bar option.

And there you have it a Windows style Taskbar along the bottom of your Mac!

Making the switch from Windows PC to Mac OS X

My first computer was Commodore 64. From there I went thru a Commodore Amiga, and several PC’s starting with MS-DOS, then Windows 95, Windows 98 and I have now been a Windows XP user for 10+ years and have never bothered to upgrade to Vista or Windows 7 because there was really no significant performance gains, and I just could not be bothered to learn something new!

So why have I all of sudden decided to get a Mac and make the switch? It’s not because I think one platform is better than the other. They both have their strengths and weaknesses, and they are just different. My reason for switching is simple… because I have started iPhone game development, which can only be done on a Mac!

My first choice was to install OS X in a virtual machine running on my PC, but it turns out that Apple’s End User License Agreement says that you have to install their software only on their hardware. In other words, you have to run Apple’s operating system on Apple’s computers! Since I do not want to be carrying two laptops around everywhere I go, I decided on the 13″ MacBook Pro 2.4GHz i5, installed VMware Fusion on it, and have Windows XP running as a virtual machine on it instead.

This transition is not for the faint of heart, especially for us power users! After 10 years of using Windows XP, I know just about every little secret there is on how to tweak and tune it, I know how to figure out just about every little problem that comes along, and (the big one) I know what all the free and open source tools are that need to make my job easier.

If you are a light PC user, who maybe surfs the net and checks your email, then the switch will probably not be a big deal. But if you are a power user like me, then I warn you … it’s been about 2 weeks of sleepless nights “making my Mac work like my PC”, and I am not done yet. Why, you might ask, would I want my Mac to work like a PC? Well having done things a certain way for years, means there are certain keystroke combinations that I always use that no longer work on a Mac! And I did not realize how much I would miss my Taskbar along the bottom of the screen.

The other issue to consider is cost. Since Windows can run on any manufacturers hardware, there is lots of competition to drive the price down. So equivalent hardware on an Apple is usually 25% to 75% more expensive.

Here are some other related posts that will be helpful:

PC style Windows Taskbar on Mac OS X

PC style Windows Keyboard shortcuts on Mac OS X

Windows style Minimize All Windows & Show Desktop on Mac OS X