Why does building an AppleScript task cause an application to be launched?

KosmicTask FAQ

Why does building an AppleScript task cause an application to be launched?

Targeting an application with a tell block will cause that application to be launched whenever the task is built. So for example:

tell application "Pages"
    set myDoc to open myPagesDoc
end tell

The above code will cause the Pages application to be launched whenever the task is built or run. The application is launched at build time in order to resolve the terminology of the commands sent to the application.

If the task code is executing on a remote machine then the application will be launched on the remote machine. This may take some time and can account for an extended build time.