# ScriptFAYTCommand

When a script calls the [**ScriptInitData**](scriptinitdata)**.AddCommand** method to [add commands](../../../scripting/example_scripts/adding_a_new_internal_command) to the Opus internal command set, the [**scriptcommand**](scriptcommand) object it retrieves provides a **ScriptFAYTCommand** object in the **fayt** property. You can initialise this object to create a command that [extends the FAYT field](../../../scripting/example_scripts/extending_the_fayt).

| Property Name | Return Type                                     | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ------------- | ----------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| backcolor     | _string_                                        | Specify the default background color for your FAYT extension. This should be in the form **#RRGGBB** (hexadecimal) or **RRR,GGG,BBB** (decimal). You should use this and the **textcolor** property to specify both dark and light colors as the same, otherwise use the **dark** and **light** properties.                                                                                                                                                                                                                                                                                                                                                                                                           |
| dark          | _object:_[**ScriptColorPair**](scriptcolorpair) | Use the [**ScriptColorPair**](scriptcolorpair) object this returns to specify the default dark mode text and background colors for your FAYT extension (and use the **light** property to specify the light mode colors). If you want the default dark and light colors to be the same, you can use the **textcolor** and **backcolor** properties instead.                                                                                                                                                                                                                                                                                                                                                           |
| enable        | _bool_                                          | Set this property to **True** to enable the FAYT extension.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| flags         | _object:_[**Map**](map)                         | <p>Lets you specify a set of flags that the user will be able to turn on or off through the user interface. To use this, you need to assign the property to a <a href="map"><strong>map</strong></a> object created by the <a href="dopus"><strong>dopus</strong></a><strong>.</strong><a href="dopusfactory"><strong>Create</strong></a><strong>.Map</strong> method.</p><p>Each flag should be added to the map with its numeric value (a power of two; e.g. 1, 2, 4, 8, ...) as the key and its label as the value. When your FAYT extension is called, Opus will add the values of the flags the user has chosen together and pass them to your command.</p><p>The maximum number of flags you can add is 16.</p> |
| key           | _string_                                        | Lets you specify a default key for your FAYT extension. Pushing this key from a file display or FAYT field will invoke the script.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| label         | _string_                                        | This lets you specify a label for your FAYT extension which is shown in the user interface. If not supplied, the name of the command is used.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| light         | _object:_[**ScriptColorPair**](scriptcolorpair) | Use the [**ScriptColorPair**](scriptcolorpair) object this returns to specify the default light mode text and background colors for your FAYT extension (and use the **dark** property to specify the dark mode colors). If you want the default dark and light colors to be the same, you can use the **textcolor** and **backcolor** properties instead.                                                                                                                                                                                                                                                                                                                                                            |
| realtime      | <p><em>bool</em><br>or <em>int</em></p>         | Set to **True** to have your extension called in realtime as the user types. If set to **False** your extension will be called only when the user presses Enter. If set to an integer value, this specifies the number of milliseconds between when the user types and your script is called (i.e. deferred notification).                                                                                                                                                                                                                                                                                                                                                                                            |
| textcolor     | _string_                                        | Specify the default text color for your FAYT extension. This should be in the form **#RRGGBB** (hexadecimal) or **RRR,GGG,BBB** (decimal). You should use this and the **backcolor** property to specify both dark and light colors as the same, otherwise use the **dark** and **light** properties.                                                                                                                                                                                                                                                                                                                                                                                                                 |
| wantempty     | _bool_                                          | Set to false if you don't want to be called for a suggestion list for an empty string (i.e. the user must type something before your extension is invoked).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
