using applescript to auto launch mac apps

 

For the six years I’ve been using a Mac, I’ve often wanted to learn how to use AppleScript to automate processes I repeat. Today I finally did.

As part of my routine for keeping my Mac running efficiently, I like to re-boot it every couple of days. And to make sure it continues to boot quickly, I’ve made sure I’ve deleted everything that wants to auto-startup at boot. That way, I get a nice, clean, quick boot if I need it.

However, there are also a number of sites and apps that I use all day that I need to run. So instead of opening them all up individually after a new boot, I’ve written an AppleScript to do it for me.

Now if you’re an old AppleScript hand, this is probably stupidly simple. But I know lots of friends and family who have moved to a Mac in recent years and who aren’t programmers, so this is for them.

The Steps.

1. Open AppleScript. It comes pre-installed on your Mac. Find it by searching Spotlight.

2. Start a new script.

3. Cut & Paste my code from below. Change the URLs you want to open and the App you want to run according to your tastes.

4. Click “Compile” on the AppleScript toolbar.

5. Flie > Save. Save it to your Applications folder. Make sure the “File Format” is “Application”. Call it whatever you want – mine is just called ‘Startup’.

6. Lastly, open up the Applications folder and drage the icon for the new app to your dock. Close AppleScript.

Now, when you boot, after the dock loads, just run the new app and it will open all of your sites and apps for you.

 

 

 

open location “http://gmail.com”

open location “http://facebook.com”

 

tell application “TextExpander”

activate

end tell

 

tell application “Alfred 2”

activate

end tell

 

tell application “CrashPlan”

activate

end tell

 

tell application “PopClip”

activate

end tell

 

tell application “Bartender”

activate

end tell

 

tell application “Fantastical”

activate

end tell

 

tell application “Moom”

activate

end tell

 

tell application “Skype”

activate

end tell

 

tell application “TweetDeck”

activate

end tell

 

tell application “Evernote”

activate

end tell

 

tell application “Spotify”

activate

end tell

Cameron Reilly's Psychopath Hunters

If you want to receive updates on my efforts to put together a global force of psychopath hunters, as well as news about my books, films, podcasts, public appearances or notification of my ultimate demise, please sign up to this newsletter.