• Blog
  • About Esrun
  • Blackhat SEO Scripts
  • Contact

Restart OS X Dock

June 10, 2009 on 10:44 am | 5 Comments

For the last 6 months or so, I’ve run into the same problem across a range of different mac computers. I go to change an application or open a finder window and it just wont work.

I have a second window changer installed which is called witch. I highly recommend using this if you don’t already since it lets you change to a specific window rather than just an application.

I originally thought the issue was with Finder but after a bit of searching, it turns out to be a problem with the Dock. I looked around for apple scripts which could restart Dock but the only one I could find was a bit hit and miss in its success. So I put together my own very simple script.

Simply create a new apple script and put in this:

do shell script "kill -HUP `ps -aux | grep Dock | grep -v grep | awk '{print $2}'`"

Save it to your desktop and next time your system stops letting you change windows and such like, simply run this script and it will restart your dock.

I used to reboot every time this happened so I’m glad I finally got around to putting a proper solution together.

5 Comments »

RSS feed for comments on this post. TrackBack URI

  1. Great Post. You have an incredible intellect and I am sorry we fell out,it was my fault not yours.

    Live Long and …….Share :)

    Keniki

    Comment by keniki — 13th August, 2009 #

  2. You guys always like The Lord of the Rings. But you never really understood it did you. When I read Lord of the Rings I found the ending horrific. A world where all diversity was removed. No magic, no wonder. Instead of a diversity where everyone formed there communities independent of control just mankind ruled. Its strange you didn’t see it the same way.

    Comment by keniki — 13th August, 2009 #

  3. Or you can try “killall Dock”

    Comment by Alex — 2nd October, 2009 #

  4. If you put [] around part of the string you are grepping for you don’t need the second grep. So

    grep Dock | grep -v grep

    becomes

    grep [D]ock

    HTH

    Comment by jumpedup — 27th January, 2010 #

  5. Yeah, killall -9 Dock

    Comment by killall — 9th April, 2010 #

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code lang=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>