Commands

    Commands are words or phrases that cause a program to do something. Here's an example of a script that includes four commands:

    Show me a script using several commands.

    This example includes these commands:
    Activate makes the Finder the active application.
    Set puts the name of the front window into a container, which the script named "windowName." This container is called a "variable" because it can contain any name. Variables are a handy way to use information in a script.
    Close tells the Finder to close the window.
    Display Dialog displays a dialog box with the specified message.

    AppleScript defines five commands: Count, Copy, Get, Set, and Run. Other programs and the scripting additions (in the Scripting Additions folder in the System Folder on your hard disk) define other commands.

 


Table of contents