• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Re: quit the dock - possible? (applescript-users digest, Vol 3 #2777)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: quit the dock - possible? (applescript-users digest, Vol 3 #2777)


  • Subject: Re: Re: quit the dock - possible? (applescript-users digest, Vol 3 #2777)
  • From: "Jonathan Levi, M.D." <email@hidden>
  • Date: Wed, 23 Jun 2004 22:26:14 -0400

On Wed, 23 Jun 2004 15:24:09 +0100, Martin Orpen <email@hidden> wrote:
on 23/6/04 12:28 pm, email@hidden at email@hidden wrote:

On 23 juin 04, at 17:28, Paul Skinner wrote:

I failed to mention that this script needs to be a stay open app. If
not, as soon as the OS notices that 'Dock.app' isn't running it will
relaunch the original Dock. The idle is set to an increment intended
to reduce the app's load on the system.
The default ide-return value for a stay-open app is 1 second IIRC.

sorry, i did not read the beginning of the thread but i actually had to
radically kill the dock yesterday and this worked:

in terminal:
a 'top' to find the dock pid
a 'grep' to get that number
a 'kill -9' that pid to kill the dock

et voila, le dock is dead !

now you only have to put that in an applescript :)

Wow, what a great idea!

I've written the script for you:

repeat
set kDock to do shell script "top -l 1 | awk '/Dock/ { print $1 }'"
do shell script "kill " & kDock
delay 2
end repeat

Very cute, indeed.

For fanatics about minimizing lines, one can contract that script to

repeat
do shell script "kill $(top -l 1 | awk '/Dock/ { print $1 }')"
delay 2
end repeat

Reducing the delay to 1 second makes the Dock appear to stay shut, but the script dies when a kill command finds the Dock closed. You can get around that with

repeat
try
do shell script "kill $(top -l 1 | awk '/Dock/ { print $1 }')"
delay 1
end try
end repeat

but you'd best be sure that not letting the Dock revive is really what you want: I put that script into ScriptMenu.menu and now I can't kill it!

Regards,

Jonathan

PS: I killed it, by the somewhat radical device of killing my window server (seems to serve as a quick way of logging out and automatically logging in as the same user): in the Terminal:

bash (omit this line if your shell is bash already)
kill $(ps -wwx | grep WindowServer | head -n 1 | awk '{print $1}')

(To see what you're killing, just type

ps -wwx | grep WindowServer | head -n 1

)
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: quit the dock - possible?
      • From: Martin Orpen <email@hidden>
    • Re: quit the dock - possible?
      • From: Gnarlodious <email@hidden>
  • Prev by Date: Re: Read resource forks wit applescript
  • Next by Date: Re: Introduction and procmail test
  • Previous by thread: Re: Filemaker Pro 7 How to get cell contents.
  • Next by thread: Re: quit the dock - possible?
  • Index(es):
    • Date
    • Thread