Previous Page
Next Page

18.1. Application Commands

A few commands may be sent to applications to start them up, bring them to the front, and make them quit. An application does not have to be scriptable to obey them (see Table 20-1 and the discussion there).

launch

Syntax

launch application

Description

Makes sure an application is running, without bringing it frontmost or making it perform any actions. This command is not commonly needed, because AppleScript, as it runs a script that targets an application locally, will automatically attempt to start up that application if it isn't running already (a good thing, since an application that isn't running can't receive any Apple events). Some applications, however, perform special actions when started up automatically in this way, such as opening a document or coming to the front. The launch command can be a way of running the application while avoiding these special actions, and there is no penalty for issuing it if the application is already running, as nothing will happen.

activate

Syntax

activate application

Description

Brings an application frontmost.

reopen

Syntax

reopen application

Description

Tells an application to behave as if it had been opened from the Finder. Some applications behave specially when told to do this. For example, in the case of the Finder, reopen makes a window open if no Finder windows are open at that moment; launch and activate don't.

quit

Syntax

quit application

Description

Tells an application to quit.


Previous Page
Next Page