HLPlanet Taditor Manual
Script Files
Previous Top Next

File extension
Taditor scripts have file extension .ESF and are usually stored in [Taditor Home\Scripts] directory. Some parts of scripts, common for several scripts are stored in .INC files and can be used as libraries of code. These files are stored in [Taditor Home\Scripts\Inc] directory.

Text encoding
Text that is stored inside these scripts have to be text-based, binary Unicode encoding is unsupported, so you need to use UTF-8 or ANSI text encoding inside scripts.

Script Precompiler
All Taditor scripts are processed using internal pre-compiler before run. This feature is language-independent. Pre-compiler process supports the following commands:

Include

Syntax:
  #include "<file_name>"

Example:
  #include "Inc\TextEditBox.inc"

Description:
  Inserts contents of a specified file in the place of command.
  Default directory for script files is [Taditor Home\Scripts].

Language

Syntax:
  #language "<language_name>"

Example:
  #language "JScript"

Description:
  Specifies language used to implement the script.
  <language_name> can be for example "VBScript" or "JScript". It is a language name that has to be recognizable for Windows Scripting Host. This command can be used only once per file. Default language for scripts is VBScript. Note that if you are using VBScript you do not have to specify the script's language.

Pragma stop

Syntax:
  #pragma stop

Example:
  see above

Description:
  Stops pre-processor execution. All lines below this command are ignored by the Taditor pre-processor.

Special functions

Taditor script engine recognizes the following special functions that should be included inside the script:

Main
This is the procedure that is executed when the script is started.

Example [VBScript]:
Sub Main
  Dim sPath

  sPath = Application.GetPath("Log")
  Application.LoadFile(sPath)
End Sub


Help
Optional, displays help information associated with the script.

Example [VBScript]:
Sub Help()
  Dim sText
  sText = "This script calculates number of occurrences " & _
    "of a selected text."
  Dialogs.MsgBox sText
End Sub

Config
Optional, configures script options.

Example (non-working, needs additional procedures, VBScript):
Sub Config()
  If Application.IsToolInstalled(ThisToolID) Then
    CheckUninstall
  Else
    CheckInstall
  End If
End Sub

© 2004-2007 HLPlanet. All rights reserved.