移動先: 概要 戻り値 フラグ. MEL 例.

概要

runTimeCommand [-annotation string] [-category string] [-categoryArray] [-command script] [-commandArray] [-commandLanguage string] [-default boolean] [-defaultCommandArray] [-delete] [-exists] [-numberOfCommands] [-numberOfDefaultCommands] [-numberOfUserCommands] [-save] [-userCommandArray] name

runTimeCommand は 「元に戻す」が可能、「照会」が可能、「編集」が可能 です。

指定した名前で MEL コマンドを作成します。作成されたコマンドはその他の MEL コマンドと同様に起動できます。このコマンドを起動すると、 command フラグにアタッチされている文字列が実行されます。

作成されたコマンドが、引数とフラグを取らないことに注意してください。 照会や編集もできません。

指定するコマンド名は固有である必要があります。名前自体は、英字かアンダースコアで始める必要があり、 その後は英数字かアンダースコアを続けることができます。

起動時に自動的に読み込まれるスクリプトでランタイム コマンドを作成する場合は、 default フラグを true に設定します。このように設定すると、アプリケーションがラン タイム コマンドを保存しようとしなくなります。

戻り値

stringコマンドの名前。

戻り値の型は照会モードでは照会フラグが基になります。

フラグ

annotation, category, categoryArray, command, commandArray, commandLanguage, default, defaultCommandArray, delete, exists, numberOfCommands, numberOfDefaultCommands, numberOfUserCommands, save, userCommandArray
ロング ネーム(ショート ネーム) 引数型 プロパティ
-exists(-ex) create
指定したオブジェクトが存在するかどうかによって、 true または false を返します。他のフラグは無視されます。
-command(-c) script createqueryedit
runTimeCommand が呼び出された場合に実行されるコマンドです。
-commandLanguage(-cl) string createqueryedit
編集または作成モードでこのフラグを使用すると、呼び出し側で 「-command」フラグに渡すコマンドのスクリプト言語を選択できます。このフラグを指定しないと、コールバックは runTimeCommand コマンドが呼び出された言語であると仮定されます。照会モードの場合、この runTimeCommand の言語が返されます。有効な値は「mel」または「python」です。
-annotation(-ann) string createqueryedit
コマンドの説明です。
-category(-cat) string createqueryedit
コマンドのカテゴリです。
-categoryArray(-caa) query
すべてのラン タイム コマンドのカテゴリを返します。
-default(-d) boolean createquery
ラン タイム コマンドをデフォルト コマンドに指定します。 デフォルトのラン タイム コマンドは、プリファレンスに保存されません。
-numberOfCommands(-nc) query
ラン タイム コマンドの数を返します。
-numberOfDefaultCommands(-ndc) query
デフォルトのラン タイム コマンドの数を返します。
-numberOfUserCommands(-nuc) query
ユーザ ラン タイム コマンドの数を返します。
-commandArray(-ca) query
すべてのラン タイム コマンド名を含む文字配列を返します。
-defaultCommandArray(-dca) query
すべてのデフォルトのラン タイム コマンド名を含む文字配列を返します。
-userCommandArray(-uca) query
すべてのユーザ ラン タイム コマンドの名前を含む文字配列を返します。
-save(-s) edit
すべてのユーザ ラン タイム コマンドを保存します。
-delete(-del) edit
指定したユーザ ラン タイム コマンドを削除します。

: コマンドの作成モードで使用可能なフラグ : コマンドの編集モードで使用可能なフラグ
: コマンドの照会モードで使用可能なフラグ : 1 つのコマンドで複数回使用可能なフラグ

MEL 例

//    Create a command that simply prints a message.  After executing
//    the following lines enter the command name <i>MyHelloCommand</i>
//    in the Command Line.
//
if (!`runTimeCommand -exists MyHelloCommand`) {
    runTimeCommand
        -annotation "Print the word \"Hello\""
        -command ("print \"Hello\\n\"")
        MyHelloCommand;
}

//    Create a window with a button that invokes the <i>MyHelloCommand</i>
//    command.
//
window;
paneLayout;
button -command ("MyHelloCommand");
showWindow;