~~Title: ScriptInitData ~~ The **ScriptInitData** object is passed to the **[[..:scripting_events:oninit|OnInit]]** event in a [[:scripting:script_add-ins|script add-in]]. The script should initialize the various properties to identify itself, and can optionally [[:scripting:example_scripts:adding_a_new_internal_command|add internal commands]] using the **AddCommand** method, and [[:scripting:example_scripts:adding_a_new_column|custom columns]] using the **AddColumn** method, before returning. $$ Property Name $$ Return Type $$ Description $$ config $$ //object://**[[scriptconfig|ScriptConfig]]**  $$ Returns a **[[scriptconfig|ScriptConfig]]** object, that the script can use to initialize its default configuration. Properties added to the object in this method will be displayed to the user in Preferences, allowing them to change their value and thus configure the behavior of the script. If you want to preserve the order of configuration items, you can replace this object with an **[[orderedmap|OrderedMap]]** by simply assigning the new object to the `config` property. $$ config_desc $$ //object://**[[map|Map]]**  $$ This lets you assign descriptions for your script's configuration options that are shown to the user in the editor dialog. To do this, set this property to a **[[map|Map]]** created via the **[[dopusfactory|DOpusFactory]].Map** method, filled with name/description string pairs. $$ config_groups $$ //object://**[[map|Map]]**  $$ This lets you organize your script's configuration options into groups when shown to the user in the editor dialog. The group names are arbitrary - configuration options with the same group name will appear grouped together. Set this property to a **[[map|Map]]** created via the **[[dopusfactory|DOpusFactory]].Map** method, filled with name/group string pairs. $$ config_group_order $$ //object://**[[vector|Vector]]** $$ This lets you control the order of configuration item groups for your script. To use this, set the property to a **[[vector|Vector]]** object (created by the **[[dopus|DOpus]].NewVector** method), and push the group names onto the vector in the desired order. $$ config_types $$ //object://**[[map|Map]]**  $$ While the type of a configuration option is normally inferred automatically, this lets you explicitly set the type which may be needed in some cases. For example, you can mark a value as a float even if its default is zero or a whole number. Set this property to a **[[map|Map]]** created via the **[[dopusfactory|DOpusFactory]].Map** method, filled with name/type string pairs. Valid type strings are "float" (floating point number) and "multiline" (multiline string). You can also specify the number of decimal places, e.g. "float:3". $$ copyright $$ //string// $$ Lets the script specify a copyright message that is displayed to the user in Preferences. $$ default_enable $$ //bool// $$ Set this to **True** if the script should be enabled by default, or **False** if it should be disabled by default. The user can enable or disable scripts using Preferences - this simply controls the default state. $$ desc $$ //string// $$ Lets the script specify a description message that is displayed to the user in Preferences. $$ early_dblclk $$ //bool// $$ Set this to **True** if your script implements the **[[..:scripting_events:ondoubleclick|OnDoubleClick]]** event and (for performance reasons) you want to be called with only a path to the double-clicked item rather than a full **[[item|Item]]** object. See the **[[..:scripting_events:ondoubleclick|OnDoubleClick]]** event documentation for more details. $$ file $$ //string// $$ Returns the path and filename of this script. $$ group $$ //string// $$ Lets you specify an arbitrary group for this script. If scripts specify a group they will be displayed in that group in the list in Preferences. $$ log_prefix $$ string $$ Lets the script specify a string that will be prepended to any log output it performs. If not set the name of the script is used by default. $$ min_version $$ //string// $$ Specifies the minimum Opus version required. If the current version is less than the specified version the script will be disabled. You can specify the major version only (e.g. //"11"//), a major and minor version (e.g. //"11.3"//) or a specific beta version (e.g. //"11.3.1"// for 11.3 Beta 1). $$ name $$ //string// $$ Lets the script specify a display name for the script that is shown in Preferences. $$ startup $$ //bool// $$ The **OnInit** method is called in two different circumstances - once during Opus startup, and again if the script is installed or edited when Opus is already running. This property will return **True** if the **OnInit** method is being called during Opus startup, or **False** for any other time. $$ url $$ //string// $$ Lets you provide a URL where the user can go to find out more about your script (it's displayed to the user in Preferences). $$ vars $$ //object://**[[vars|Vars]]**  $$ Returns a **[[vars|Vars]]** collection of user and script-defined variables that are local to this script. These variables are available to other methods in the script via the **[[script|Script]].vars** property. $$ version $$ //string// $$ Lets the script specify a version number string that is displayed to the user in Preferences. $$ Method Name $$ **Arguments** $$ Return Type $$ Description $$ AddColumn $$ //none// $$ //object://**[[scriptcolumn|ScriptColumn]]**  $$ Adds a new information column to Opus. The returned **[[scriptcolumn|ScriptColumn]]** object must be properly initialized. A script add-in can add as many columns as it likes, and these will be available in file displays, infotips and the **[[:basic_concepts:searching_and_filtering:find_files:advanced_find|Advanced Find]]** function. Instead of adding columns in **OnInit**, your script can implement the **[[..:scripting_events:onaddcolumns|OnAddColumns]]** method. This is more flexible as it allows you to access your script's configuration at the time you add columns, and columns can be dynamically added and removed while Opus is running. If **[[..:scripting_events:onaddcolumns|OnAddColumns]]** is implemented then this method is unavailable in **OnInit**. $$ AddCommand $$ //none// $$ //object://**[[scriptcommand|ScriptCommand]]**  $$ Adds a new internal command to Opus. The returned **[[scriptcommand|ScriptCommand]]** object must be properly initialized. A script add-in can add as many internal commands as it likes to the Opus internal command set. Instead of adding commands in **OnInit**, your script can implement the **[[..:scripting_events:onaddcommands|OnAddCommands]]** method. This is more flexible as it allows you to access your script's configuration at the time you add commands, and commands can be dynamically added and removed while Opus is running. If **[[..:scripting_events:onaddcommands|OnAddCommands]]** is implemented then this method is unavailable in **OnInit**.