Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Are there any real alternatives to force quit dialog on mac?

Alternative, just a command/app that kills every running app (not process)?

share|improve this question
    
It's hard to tell exactly what you're looking for, but would the Activity Monitor do what you are interested in? –  Stephen Jul 18 '11 at 22:57
    
Nope, because I will still need to use it, while the system hangs –  Tyilo Jul 18 '11 at 22:58
    
What can Task Manager do that Activity Monitor and Force Quit can't? –  Nathan Greenstein Jul 18 '11 at 23:16
    
Not specifically Task Manager, but the dialog with logout, shutdown, task manager etc. –  Tyilo Jul 18 '11 at 23:21
    
My question is why is your system hanging so much that you need to do this at all? –  Lyken Jul 18 '11 at 23:24
show 2 more comments

2 Answers

up vote 3 down vote accepted

Found how to accomplish what i want:

  • Create spark applescript command doing do shell script "sudo killall loginwindow"
  • Edit /etc/sudoers to allow doing above without password prompt: Tyilo ALL=NOPASSWD:/usr/bin/killall
share|improve this answer
2  
You might also enable ssh - prompt or other iOS ssh tool will often still get into a mac that can't exec an AppleScript. Even when loginwindow and/or finder are non-responsive, the force quit keystrokes have priority to bring up the force quit floating dialog –  bmike Jul 19 '11 at 0:32
add comment

Here is a keyboard combo ⌘ ⌥ ESC (Command-Option-ESC or Command-Alt-ESC) what bring in a small Force quit window.

but, when your script every 0.25 sec clicking somewhere, you will lose focus on ANY window.

You can for example try in another terminal window the following

seconds=20
script="name_of_the_script"
sleep $seconds ; killall "$script"

that small script will sleep 20 seconds, and after will kill all processes with the name "name_of_the_script".

Another variant is - rewrite you script for keypress check. For example, the next shell script will run until you press "q". Because you don't tell how you do "clicking" (via applescript? via iKey?) can't tell better solution.

#!/bin/bash

cnt=0
do_stuff() {
        let cnt++
        echo "Doing stuff here $cnt"
}

#MAIN LOOP
#set terminal into nonblocking mode
stty -icanon
key=''
while [[ "$key" != "q" ]]
do
        read key
        do_stuff
done

#resetting terminal into normal mode
stty sane
echo DONE
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.