Expose stop working after connecting to external monitor

When ever I unplug my MacBook from an external monitor, Expose stops working. The solution to this problem is to kill "Dock" application.  To make it easier, I have created a script which allows you to do the same.

set app_name to "/System/Library/CoreServices/Dock.app/Contents/MacOS/Dock"
set the_pid to (do shell script "ps ax | grep " & (quoted form of app_name) & " | grep -v grep | awk '{print $1}'")
display dialog "Killingn the application Dock with PID:" & the_pid
if the_pid is not "" then do shell script ("kill -9 " & the_pid)

Copy following lines of code into text editor and copy under $HOME/Library/Scripts/killdock.scpt.  Now you can see the script listed under scripts as an shortcut. You can see "kill dock" listed at the end.

3 comments:

said...

只有尋常才幹,但具有不尋常恆心的人,一切皆可獲取 ..................................................

小小 said...

不費勞力而得者,唯貧困而已 ..................................................

yahoo said...

要持續更新下去喲!!祝你心情愉快 ........................................