Open or Quit all Applications at Once with AppleScript

Script EditorAs a front end web developer, I find myself opening the same applications every morning in the same monotonous way.  I decided it would be nice if I could just open them all with one click on the mouse.  And so, I dug into a little Applescript.

Here are 4 easy steps to get set up to open all the applications you use on a daily basis with one simple click of the mouse.

 

First: navigate to Applications > AppleScript > Script Editor.  Open Script Editor.  This is where we can write and save a simple AppleScript to open all the apps that we want to open.  You will see a window popup that looks like this:

AppleScript Window

Second: now we just have to write our script and it couldn’t be easier.  For each application that we want to open we write:

tell application “Mail”
activate
end tell

tell application “Firefox”
activate
end tell

etc. etc. for each application that we want to open.  You can hit ‘Run’ in the toolbar to see your script in action.

Third: Now we want to save our script so we can reuse it every morning.  Go to File > Save and save it as whatever name you would like, but save it to this location: Your_Home_Folder/Library/Scripts.  If a ‘Scripts’ folder does not exist you can go ahead and create one in this location.  This is where you should save all of your AppleScripts.

Fourth: At this point, you are basically up and running, you could just navigate to your scripts folder every morning, double click the script and run it to open your applications, but that doesn’t seem very efficient.  Instead, it would be great to have a button in our main menu bar that we can click to run this script.  Good news, we can do just that!  Navigate to Applications > AppleScript > AppleScript Utility and check ‘Show Script menu in menu bar‘. 

AppleScript menu bar

Now we have a little icon that we can click on.  When we click this icon we get a drop down of all our scripts.  At the bottom you should see your script.  Simply click on it to run it!

Bonus Material!

It would be just as great if we could easily quit all of our open applications at the end of the day with just one click.  Good news again, that is even easier to do!

Open up Automator in your Applications folder.  Choose ‘Custom‘ as your starting (this gives you a blank canvas to start with).  Make sure ‘Actions’ is highlighted and click on ‘library’.  In the column to the right of ‘library’, scroll down to ‘Quit All Applications’.  Click on this and drag and drop it into the empty space to the right.

Now all you have to do is save this script. Go to File > Save and name it whatever you like, but remember to save it to Your_Home_Folder/Library/Scripts.  Now, when you click on the AppleScript icon in the menu bar, you will see your ‘quit all applications’ script.  Simply click on it to quit all open applications.

I hope this article has been helpful and please let me know of any questions or other suggestions.

Post a Comment

Your email is never shared. Required fields are marked *