====== The Script Manager ======
The //script manager// window, shown below, allows the user to load, edit and remove scripts from the [[:l3dt:userguide:scripts:menu|scripts menu]]. It is opened via the '//Scripts->Script manager//' menu item.
| {{l3dt:userguide:dialogs:scriptmanager.png|The script manager dialog.}} |
^ The 'script manager' window ^
===== Creating a script =====
To create a script, click on the '<< new script >>' option at the top of the script list, and press the '//Create//' button. This will create a new script and open the [[:l3dt:userguide:scripts:editor|script editor]] window.
The '//Load//' button changes to a '//Create//' button when the '<< new script >>' option is selected from the top of the script list.
This option is not available if you have used the '//Scripts->Set preferred editor//' menu item to select an editor other than L3DT's default script editor. If you have done this, create and save the script in your preferred editor, then use the '//Load//' button in this window to load it in L3DT.
===== Loading a script =====
To load a script file from disk, select the 'Load' button. This will open a file dialog in which you may select the file to load. At the time of writing, L3DT supports the following script file types:
* ".zs" --- ZeoScript, see [[bundywiki>plugins:general:zeoscript|ZeoScript plugin]] for more info.
* ".py" --- Python script, see [[bundywiki>plugins:general:cdPython|cdPython plugin]] for more info.
More script languages may be added as new script plugins are developed.
To use python scripts, you must install the [[bundywiki>plugins:general:cdPython|cdPython]] plugin by Carl Douglas.
==== Default script directory ====
You can store scripts in any directory on disk that you like. However, the default directory used by L3DT is:
^ Win 7 / Vista | C:\User\[user name]\L3DT\Resources\[version]\Scripts\ |
^ Win XP / 2000 | C:\Documents and Settings\[user name]\L3DT\Resources\[version]\Scripts\ |
==== Automatic loading of scripts ====
On start-up, L3DT will automatically load any script files contained within the script resources directory given above.
===== Editing a script =====
To edit a script, select it from the list and press the 'Edit' button. If you have set a preferred script editor using the '//Scripts->Set preferred editor//' menu option, then L3DT will open the selected script in your preferred editor. If you have not set a preferred editor, L3DT will open the script in the default [[l3dt:userguide:scripts:editor|script editor]] window.
===== Removing a script =====
The 'remove' button removes the script from the list, and __deletes it from disk__. This operation cannot be undone.
===== Sorting scripts =====
The 'Up' and 'Dn' (down) buttons allow you to sort the order of the scripts. To move a script up the list, select it using a left click, then press the 'Up' button (similarly, press 'Dn' to move the script down). The first ten scripts in the list will be displayed in the [[:l3dt:userguide:scripts:menu|scripts menu]] for quick execution. Hence, it is recommended that you sort your most commonly-used scripts to be at the top of the list in the manager.