If you use OS X and you use OS X’s command line or cron scripts, you can combine AppleScript with the command line. If you have no idea what that last sentence means, you can safely skip this chapter. This is not a tutorial on using the command line or on using Unix.
- Running AppleScript from the Command Line
- The easiest way to add an AppleScript to your command line application is through the “open” command. If you type “open ~/Documents/MyAppleScript” on the command line, your AppleScript called “MyAppleScript” in your Documents folder will run. You can use “open” in conjunction with cron, with Perl scripts, or with any of the shell scripting languages. Call it as you would any other command line utility.
- Calling the Command Line from AppleScript
- You can also call your command-line scripts and utilities from within your AppleScripts. Use the “do shell script” command for that. For example, if you have a Perl script called “makeHTML” in “/usr/local/bin” you could use