jloveblaze Posted March 29, 2013 Share Posted March 29, 2013 (edited) Sometimes I have so many apps running and want to simplify without restart. I'd like to keep the focused app open if possible, most times this is Chrome. I searched extensively online and found the below applescript. I have been trying to tweak it but am unable to reach success. I appreciate the support of this community and would be very thankful for any help. tell application "System Events" to set the visible of every process to true set white_list to {"Finder"} try tell application "Finder" set process_list to the name of every process whose visible is true end tell repeat with i from 1 to (number of items in process_list) set this_process to item i of the process_list if this_process is not in white_list then tell application this_process quit end tell end if end repeat on error tell the current application to display dialog "An error has occurred!" & return & "This script will now quit" buttons {"Quit"} default button 1 with icon 0 end try Edited March 30, 2013 by jloveblaze Link to comment
hzlzh Posted March 30, 2013 Share Posted March 30, 2013 Oh this is a quick action like `command+option+ESC`. Link to comment
jloveblaze Posted March 30, 2013 Author Share Posted March 30, 2013 Oh this is a quick action like `command+option+ESC`. I appreciate your quick response but I know how to bring up the option command menu an pick the apps. I am looking for a way to use alfred to close all apps without having to manually go to that menu and force quit each app. The script I posted above I think sheds some light on how to work it. Im just not sure how to make an Alfred Workflow out of it. Thanks! Link to comment
hzlzh Posted March 30, 2013 Share Posted March 30, 2013 (edited) Try this workflow I just filled in with your code. http://d.pr/f/6BAq Edited March 30, 2013 by hzlzh Link to comment
jloveblaze Posted March 30, 2013 Author Share Posted March 30, 2013 (edited) @Hzlzh That worked Excellently! It forced quit all apps. Thank you so much for packaging it an hosting it. I saw you included the language: /osascript which is something I wasn't doing. Which modifier can I add to the code to make an exception for specific a specific app? (so all apps but a specific one close) I tried to make it so that all apps closed except for Chrome by replacing all instances of the words "Finder" with the words "Chrome" but Finder still stayed open and Chrome closed... Will look into this more. Thanks again for going over and beyond to help! Edited March 30, 2013 by jloveblaze Link to comment
jloveblaze Posted March 30, 2013 Author Share Posted March 30, 2013 Anyone with ideas on how to whitelist an app so that it does not force quit with all others please advise. Aloha Link to comment
silvine Posted March 30, 2013 Share Posted March 30, 2013 The workflow worked great for me. What about an icon? Also is it possible to get this workflow to minimise or close all the background Finder windows? Link to comment
jloveblaze Posted March 30, 2013 Author Share Posted March 30, 2013 (edited) The workflow worked great for me. What about an icon? Also is it possible to get this workflow to minimise or close all the background Finder windows? Use Total Finder or Xtrafinder (Free) to condense finder windows into tabs and you won't have that problem.. Edited March 30, 2013 by jloveblaze Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now