Name

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.

Get AppleScript: The Definitive Guide, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.