AppleScript

AppleScript: A framework to speed up your login time

2011-11-11 by Nathan Greenstein. 5 comments

Background

On older Macs, startup can take a long time. One of the main causes of this is apps that launch at startup. These apps can take the form of menu-bar apps like Dropbox and Growl, or full-fledged apps that you always use and have set to open at login.

Chances are, you don’t need to use all of those apps immediately after you log in. Today I’m going to share a way to use AppleScript to stagger the launch of these apps. That way, the apps you need first can start launching before the apps that you need later. Apps open faster when there is less ‘competition’ from others opening at the same time, so you’ll be able to use the apps you want first sooner after you log in.

On my older MacBook, the time from showing my desktop to loading all my startup items was shortened from 42 seconds to 35 seconds.

more »

AppleScript: Workspace-based App Launcher

2011-10-21 by Nathan Greenstein. 5 comments

Welcome back to AppleScripting! To see what we’ve done so far, take a look at the AppleScript category. We’re jumping ahead a bit, but you should be able to catch on fine. As always, if you have questions you can ask in the comments and on Ask Different.

Today we’ll be making a workspace-based app launcher. Once we’re done, you’ll be able to choose a workspace (e.g., “Programming”) from a list and automatically have AppleScript launch the apps you use in that workspace.
The scirpt will use many different parts of AppleScript; including loops, lists of records, and tell blocks.

To begin, create a new script in AppleScript editor. See the Introduction to AppleScript post if you need a reminder of how to do that.
Let’s get right into the code.

more »

AppleScript sales-tax calculator: Variables, operations, and comments

2011-10-03 by Nathan Greenstein. 1 comments

Welcome back to AppleScripting! So far, we’ve learned about what AppleScript is for, and said hello. Today we’ll really be diving into the language. We will talk about variables, datatypes, operations, comments, and some basic debugging. First I’ll introduce you to the concepts, and then we’ll look at a small example application: a sales-tax calculator. Let’s begin.

more »

Introduction to AppleScript: Hello World

2011-09-28 by Nathan Greenstein. 6 comments

Many Mac users have heard of AppleScript. They know that it exists, and maybe they’ve even tried it out. But few people have actually learned AppleScript and seen how it can help them do more with their Mac. That’s why I’m here. I’ve been AppleScripting for a long time, and my goal is to teach you a little something. Over the course of this five-post series, I will be giving you an introduction to AppleScript that I believe is both fast-paced and accessible. If you’ve programmed or scripted before, great; you’ll catch on quick. If not, you’ll still be able to keep up fine and learn a lot from this series; AppleScript is a fun first language. And the best part is, you’ve got a great resource for any questions: Ask Different! Just ask your question on the site and I or another user will help you out. So, without further ado, let’s jump right in!

more »