Before we get to our first script, I thought that I’d post a quick screencast of a script in action. This screencast shows some of the power of scripting. In the screencast, I grab some data from a text file, parse that data, then send the data to Timeline to create a beautiful timeline.
Click here to view the screencast
As you can see, I’ve used this script to create a timeline of events in a litigation context. In this case, I used a simple text file as my data source, but you could also use a database like FileMaker Pro or a spreadsheet like Microsoft Excel to hold your data. (Not that there’s anything wrong with plain text, mind you.) More importantly, however, I saved valuable time by not having to enter the data twice–once into my data source and again into Timeline. And I can use the script over and over again, saving more time every time I use the script. I timed the script execution to around 2 seconds. I then manually entered the events to create the timeline and finished in 240 seconds. Every time I use this script, then, I save almost four minutes of my time. This is the power of scripting.
On to our first script!
Open Script Editor and type the following text into the editor pane:
say "Hello from AppleScript!"
Now click the “Run” button or press Command+R. You should have seen the text change color and then you should have heard your computer speak the words, “Hello from AppleScript”. Cool!
So what happened? When you clicked the “Run” button, Script Editor secretly compiled the program first. When Script Editor compiles a program, it checks for errors in your code, then converts your code to machine code for the computer to read. Here, the translated code sent a command—the “say” command—to the computer along with an argument for the command—the text string “Hello from AppleScript—and the computer obeyed your command and said the words, “Hello from AppleScript”. The key lesson to remember is that, in AppleScript, you “tell” your applications to do things using “commands”. Who’s the boss, now?
How do you know what commands you can send to an application? For that you need to know about AppleScript dictionaries, the subject of the next post.

Kyle on March 12th, 2008 at 9:41 says:
I had no idea that AppleScript could do something like your Timeline demonstration. I use Timeline extensively in my practice, and this tip could significantly help to streamline my processes.
I look forward to more tips!
AppleScript Dictionaries | Scripting for Lawyers on March 12th, 2008 at 22:17 says:
[...] our first script, we commanded the computer to “say” “Hello from AppleScript”. We also [...]
Grace Suarez on March 13th, 2008 at 12:44 says:
What fun! I actually laughed and clapped my hands when the computer spoke (okay, I’m easily amused).
Your blog is so much fun. I can see doing really useful tasks with scripting. Keep up the good work.
statonjr on March 13th, 2008 at 12:47 says:
@Grace: You can imagine other possibilities for using the “say” command. I like to use it when a long-running script completes. If I’m manipulating several hundred images, I might run the script, then do something else. I know when the script completes because the script will “say”, “Rendering of images completed” or something like that. We’ll look at the say command in more detail soon.
Warwick Rothnie on March 16th, 2008 at 22:26 says:
Fantastic, Larry. You are starting to inspire me to try this!
I am a bit confused about why there’s Applescript and Automator though.
Landya on April 12th, 2008 at 8:57 says:
Okay, I just found this wonderful site. (macsparky.com)
I just watched the Timeline screencast.
I use Timeline all the time. I would love this script! Is there a way to simply download a script and install it? No clue.
This should be a feature of Timeline. What a timesaver!