5.1.1:What is a Script

スクリプトとは

Every object in Revolution can contain a script, which tells it what to do. You edit the script of an object using the
Script Editor (see The Script Editor). A script is organized into a set of individual message handlers, each one of which can respond to a different event (see Messages) or contain a specific piece of functionality. Scripts can send messages to each other. In a well organized application, a script will regularly pass data between different types of message handlers which have been grouped and organized to deliver functionality, with a minimum of duplication. A script can contain sections of code that is commented – remarks that are intended for a human to read and are not executed. Technically a script is simply another object property, so one script can set another – within certain limits.

レヴォルーションではオブジェクト全てにスクリプトを書きこむことができ、このスクリプトがオブジェクトの果たすべき役割を記述しているわけです。オブジェクトのスクリプトを編集するにはスクリプト・エディタを使います(The Script Editor参照)。スクリプトは関連する幾つかのメッセージ・ハンドラから成っています。メッセージ・ハンドラの一つ一つは異なるイヴェントに反応することができ(Messages参照)、或いは個々のハンドラには果たすべき特定の機能の一部を含むことができます。スクリプトは相互にメッセージを送りあうことができます。巧く仕上げられたアプリケーションでは、スクリプトはグループ化され統制された異なる形式のメッセージ・ハンドラ間で機能の実行を最小限のデータ重複で達成するために、定期的にデータを受け渡しています。スクリプトには、コンピュータが実行するためにではなく、人間に読ませるためのコメント用の「-」印を含めることができます。技術的に言えば、スクリプトは単に他のオブジェクトのプロパティであり、あるスクリプトで他のスクリプトを、ある程度の制限はあるものの、設定することができます。