1

I've been learning lots of different programming languages when I came across AppleScript. Since I'm technically new to it, this question may seem dumb.

I need an AppleScript script to quit the "Force Quit Applications" app.

The following code doesn't work:

tell application "Force Quit Applications" to quit

Probably it's because the process has a different name. What is the "Force Quit Applications" process name? Many thanks in advance.

2

You can use this Apple Script to close this window:

tell application "System Events"
    key code 53 using {command down, option down} -- ESC + ALT + CMD
    keystroke "w" using command down
end tell

This window is owned by loginwindow process and it's not that easy to interact with it. Here's the code to press Force Quit button on this window:

tell application "System Events" to tell process "loginwindow"
    click button 1 of window 1 
end tell

However this does not work:

tell application "System Events" to tell process "loginwindow"
    close window 1
end tell
  • Good answer, just makes me sad there's no way to do this without GUI scripting. Oh well. One day. – JMY1000 May 2 '16 at 19:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .