Unless you plan to display dialog boxes in Script Editor all day, you're probably feeling pretty constrained by AppleScript right now. Yeah, you can display cool stuff in your dialog boxes, but that won't be enough to automate your Mac.
Luckily, you can use AppleScript to do other things—and one of the most powerful is the ability to control other applications. This feature alone unlocks a world of possibilities:
Before you can write any of those complicated scripts, however, you must learn the basics of program control. This section, therefore, introduces the basics of how to send commands to specific programs, rather than just to Mac OS X itself.
When you want to target a program with your commands, you have to let AppleScript know which program to talk to. For such purposes, the tell statement is your best friend.
Say you want the Finder to open your Home folder, so you can copy some files onto your desktop. To do this, enter these commands in Script Editor, then click Run:
tell application "Finder" activate open home end tell
Everything after the tell command is directed at the program you specify—in this case, the Finder. The activate command ...