Dialog: Customize / External Editor

<< Click to Display Table of Contents >>

Navigation:  Reference (Scripting) >

Dialog: Customize / External Editor

Menu Scripting > config_scripteditor Customize / External Editor

 

Use external application as Docklight Script Editor

 

Check this option to disable the built-in script editor, and launch an external editor application for this purpose.

 

A flexible configuration syntax allows you to work with almost any editor that at least supports opening a file using a command line like

myEditor.exe tempScriptFile.vbs

 

Application Control

 

This configuration file defines how Docklight Scripting controls the external editor.

 

Load preset for...

 

Predefined configuration files for three widely available editors.

 

TIP: We recommend the Notepad++ editor available at http://notepad-plus.sourceforge.net. The Windows Notepad example is just for illustrative purposes and explains how the configuration files work. You can use it as a starting point for integrating your own editor.

 

How to integrate your own favorite editor

 

You can set the application path at the beginning of the configuration file, using the path= syntax. Example line:

path=C:\Program Files\Notepad++

 

All following lines of the configuration file have the following syntax:

<Edit Action> <Application Control>

 
Example line:

open: notepad.exe "%FILE%"

 

<Edit Action> can be one of the following Docklight editing actions:

 

Edit Action

Description

open:

Open a new script code file

goto:

Go to a line number within the script file

save:

Save the current file open

close:

Close the current file open

 

<Application Control> can be one of the following operations:

 

Application Control

Description

sendkeys

Send one or more keystrokes to the external editor. It uses the same argument syntax as the Windows Script Host SendKeys method. See the related Microsoft documentation for details. Example:

goto: sendkeys +^{HOME}{DOWN %LINE%}+{UP}

endtask

End the external application. Example:

close: endtask

activate

Activate the external application window. Example:

goto: activate

sleep

Wait up to 500 milliseconds to give the external application some extra time to sort things out. This might be necessary when working with the sendkeys: operation described above. Example:

open: sleep 100

Command Line

Besides the above operations, you can execute any Windows command line, e.g. for launching your external editor. Example:

open: notepad++.exe -nosession -lvb -n%LINE% "%FILE%"

 

For each <Edit Action> you can define several command lines, e.g.

goto: sendkeys +^{HOME}{DOWN %LINE%}+{UP}

goto: activate

 

The following wildcards are available for <Application Control>

 

Wildcard

Description

%FILE%

Path to a temporary file containing the script code to edit. Docklight Scripting creates and manages the temporary file.

%FILE_UNIX%

Same as %FILE%, but uses a UNIX-style '/' for the path separator. This is useful for some open source editor packages that have problems with the Windows backslash ('\') separator.

%FILE_ESC%

Same as %FILE%, but uses a double backslash ('escape sequence') for the path separator. This is necessary e.g. when working with the SciTE free source code editor.

%LINE%

The current source code line number. This is used for the goto: action.

 

Remarks

 

The External Editor Support is a flexible and open solution to our users who are working with large script projects and would prefer to work with a full-featured editing package.

 

The application control interface offered described above gives you flexibility, but we are aware of the limitations of controlling third-party applications that are not really designed to be controlled from outside.

 

If you find a smart configuration file for your personal favorite editor, or you are experiencing problems with the above interface, our Customer Support would be happy to hear about it.