ScriptWorx Help: Extending ScriptWorx

Welcome to Extending ScriptWorx 5!

This guide takes you through the many ways in which ScriptWorx can be customized to suite your needs.

Don't forget to visit us on the web: SoftLite Homepage


Extending ScriptWorx: Overview

Extending ScriptWorx - Overview

ScriptWorx can be extended in several ways using JavaScript, VBScript or Perl. By using any of these languages, you can add new features, technology support and productivity tools.

The ScriptWorx API can be rapidly accessed through these languages, without the need for specialist knowledge. Throughout this guide, we will work more closely with JavaScript, our recommended option for extending ScriptWorx.


Extending ScriptWorx: Overview

Extending ScriptWorx - Built-in Functions

The ScriptWorx API supports several hundred built-in functions, each of which can have variables and constants passed into them.

Before we begin, it is important to note that variables in ScriptWorx do not have a type - that is, strings, integers and so on are treated differently and do not have to be declared as such.

Please click a function for more information.

  • SAbout
  • SActiveX
  • SAnchor
  • SBlink
  • SBodyProperties
  • SBold
  • SCascade
  • SCFBuilder
  • SClose
  • SCloseAll
  • SCompressDoc
  • SCopy
  • SCut
  • SDownloadTimer
  • SExit
  • SFind
  • SFont
  • SFormatFixHTML
  • SFormatHTML
  • SGotoBottom
  • SGotoLine
  • SGotoTop
  • SHelp
  • SHorizontalRule
  • SHyperlink
  • SImage
  • SImageConvert
  • SImageMap
  • SItalic
  • SJava
  • SJavaScript
  • SLayer
  • SLineBreak
  • SLinkValidator
  • SMeta
  • SMultiReplace
  • SNavMenu
  • SNew
  • SNext
  • SNoBrSpace
  • SOpenLocal
  • SOpenRemote
  • SPageSetup
  • SPaste
  • SPlugin
  • SPreferences
  • SPrevious
  • SPrint
  • SProfileSelect
  • SProperties
  • SRedo
  • SReplace
  • SRollover
  • SSave
  • SSaveAs
  • SSelectAll
  • SSiteWorx
  • SSpellCheck
  • SStrike
  • SStyleSheet
  • STable
  • STidytoCSS
  • STidytoXML
  • STidytoXHTML
  • STile
  • STimestamp
  • STransitions
  • SUnderline
  • SUndo
  • SUpdateScriptWorx
  • SValidate
  • SWBMPConvert


Extending ScriptWorx: Built-in Functions:

Extending ScriptWorx - SAbout

Sample Usage:
SAbout();

Background:

Launches the ScriptWorx "About" dialog box, which provides copyright notices and version information.

Variables:

None


Extending ScriptWorx - SActiveX

Sample Usage:
SActiveX();

Background:

Inserts HTML code into the current document to allow the embedding of an ActiveX control within a web page.

Variables:

None.


Extending ScriptWorx - SAnchor

Sample Usage:
SAnchor();

Background:

Inserts code into the current document to allow for the embedding of an HTML anchor.


Extending ScriptWorx - SBlink

Sample Usage:
SBlink();

Background:

Inserts code into the current document to allow for the embedding of the HTML "blink" tag which flashes text in Netscape Navigator.


Extending ScriptWorx - SBodyProperties

Sample Usage:
SBodyProperties();

Background:

Launches the page properties dialog form which can modify the <body> tag of an HTML document.


Extending ScriptWorx - SBold

Sample Usage:
SBold();

Background:

This function applies the HTML bold format to selected text within the current document.


Extending ScriptWorx - SCascade

Sample Usage:
SCascade();

Background:

Arranges all open editing windows in a 'stacked' formation, with windows in front of and behind each other for easy selection.


Extending ScriptWorx - SCFBuilder

Sample Usage:
SCFBuilder();

Background:

Launches the Cold Fusion document building tool.


Extending ScriptWorx - SClose

Sample Usage:
SClose();

Background:

Closes the currently active editing window.


Extending ScriptWorx - SCloseAll

Sample Usage:
SCloseAll();

Background:

Closes all currently open editing windows.


Extending ScriptWorx - SCompressDoc

Sample Usage:
SCompressDoc();

Background:

Launches the HTML document compression tool, removing extraneous and unnecessary code from files.


Extending ScriptWorx - SCopy

Sample Usage:
SCopy();

Background:

Copies the currently selected text in the active editing window to the clipboard.


Extending ScriptWorx - SCut

Sample Usage:
SCut();

Background:

Cuts the currently selected text in the active editing window to the clipboard.


Extending ScriptWorx - SDownloadTimer

Sample Usage:
SDownloadTimer();

Background:

Launches the download timer tool for analyzing the time taken to download a file at various modem speeds.


Extending ScriptWorx - SExit

Sample Usage:
SExit();

Background:

Quits the ScriptWorx application.


Extending ScriptWorx - SFind

Sample Usage:
SFind();

Background:

Launches the "find" dialog box for locating text within a file.


Extending ScriptWorx - SFont

Sample Usage:
SFont();

Background:

Launches the font formatting dialog box for formatting text in documents with HTML and CSS.


Extending ScriptWorx - SFormatFixHTML

Sample Usage:
SFormatFixHTML();

Background:

Applies source code formatting to the active file, whilst repairing any syntax errors within the code.


Extending ScriptWorx - SFormatHTML

Sample Usage:
SFormatHTML();

Background:

Applies source code formatting to the active file.


Extending ScriptWorx - SGoToBottom

Sample Usage:
SGotoBottom();

Background:

Jumps to the bottom-most line of active document.


Extending ScriptWorx - SGoToLine

Sample Usage:
SGotoLine();

Background:

Jumps to a specific line number in the active document.


Extending ScriptWorx - SGoToTop

Sample Usage:
SGotoTop();

Background:

Jumps to the top-most line in the active document.


Extending ScriptWorx - SHelp

Sample Usage:
SHelp();

Background:

Launches the ScriptWorx Help System.


Extending ScriptWorx - SHorizontalRule

Sample Usage:
SHorizontalRule();

Background:

Inserts HTML code into the current document to embed a horizontal rule into the current page.


Extending ScriptWorx - SHyperlink

Sample Usage:
SHyperlink();

Background:

Shows the insert "hyperlink" dialog box for embedding HTML hyperlinks into the current document.


Extending ScriptWorx - SImage

Sample Usage:
SImage();

Background:

Shows the insert "image" dialog box for embedding images into the current document.


Extending ScriptWorx - SImageConvert

Sample Usage:
SImageConvert();

Background:

Launches the image conversion utility for converting common image formats to web-friendly images.


Extending ScriptWorx - SImageMap

Sample Usage:
SImageMap();

Background:

Launches the visual creation tool for generating and embedding image maps into the current document.


Extending ScriptWorx - SItalic

Sample Usage:
SItalic();

Background:

Embeds the HTML italic tag into the current document to render italic text in a web browser.


Extending ScriptWorx - SJava

Sample Usage:
SJava();

Background:

Launches the "Insert Java Applet" dialog box for adding Java applets to HTML documents.


Extending ScriptWorx - SJavaScript

Sample Usage:
SJavaScript();

Background:

Launches the "Insert JavaScript" dialog box for adding JavaScripts to HTML documents.


Extending ScriptWorx - SLayer

Sample Usage:
SLayer();

Background:

Launches the "Insert Layer" dialog box for adding Dynamic HTML layers to HTML documents.


Extending ScriptWorx - SLineBreak

Sample Usage:
SLineBreak();

Background:

Inserts a hard-coded line break in HTML format into the current document.


Extending ScriptWorx - SLinkValidator

Sample Usage:
SLinkValidator();

Background:

Launches the integrated hyperlink verification tool.


Extending ScriptWorx - SMeta

Sample Usage:
SMeta();

Background:

Inserts an HTML meta tag into the current document.


Extending ScriptWorx - SMultiReplace

Sample Usage:
SMultiReplace();

Background:

Launches the extended find and replace dialog box for searching and changing text in multiple files.


Extending ScriptWorx - SNavMenu

Sample Usage:
SNavMenu();

Background:

Launches the wizard for creating Navigation Menus for HTML pages using JavaScript code.


Extending ScriptWorx - SNew

Sample Usage:
SNew();

Background:

Creates a new (blank) file for editing within ScriptWorx.


Extending ScriptWorx - SNext

Sample Usage:
SNext();

Background:

Jumps to the next editing window in order of window location within ScriptWorx.


Extending ScriptWorx - SNoBrSpace

Sample Usage:
SNoBrSpace();

Background:

Inserts an HTML code block which adds a non-breaking space to a document.


Extending ScriptWorx - SOpenLocal

Sample Usage:
SOpenLocal();

Background:

Opens a file for editing on your computer.


Extending ScriptWorx - SOpenRemote

Sample Usage:
SOpenRemote();

Background:

Opens a file for editing on the world wide web.


Extending ScriptWorx - SPageSetup

Sample Usage:
SPageSetup();

Background:

Launches the page setup dialog box for defining printer options.


Extending ScriptWorx - SPaste

Sample Usage:
SPaste();

Background:

Pastes text from the clipboard into the active document.


Extending ScriptWorx - SPlugin

Sample Usage:
SPlugin();

Background:

Inserts the necessary HTML code into the active document for using Netscape plug-ins.


Extending ScriptWorx - SPreferences

Sample Usage:
SPreferences();

Background:

Launches the ScriptWorx Preferences dialog box for customizing ScriptWorx.


Extending ScriptWorx - SPrevious

Sample Usage:
SPrevious();

Background:

Jumps to the previously opened document window.


Extending ScriptWorx - SPrint

Sample Usage:
SPrint();

Background:

Prints the active document using your printer.


Extending ScriptWorx - SProfileSelect

Sample Usage:
SProfileSelect();

Background:

Launces the ScriptWorx Profile Selector, for selecting from one of possibly many user configurations.


Extending ScriptWorx - SProperties

Sample Usage:
SProperties();

Background:

Opens the file properties dialog box providing information about the currently open document.


Extending ScriptWorx - SRedo

Sample Usage:
SRedo();

Background:

Repeats the last action performed within the editing window.


Extending ScriptWorx - SReplace

Sample Usage:
SReplace();

Background:

Launches the search and replace dialog for finding and replacing text within the current document.


Extending ScriptWorx - SRollover

Sample Usage:
SRollover();

Background:

Launches the wizard for creating web page image rollovers using HTML and JavaScript.


Extending ScriptWorx - SSave

Sample Usage:
SSave();

Background:

Saves an existing document to file using the same filename.


Extending ScriptWorx - SSaveAs

Sample Usage:
SSave();

Background:

Saves an existing or new document to file using a user-defined filename.


Extending ScriptWorx - SSelectAll

Sample Usage:
SSelectAll();

Background:

Selects all the text in the currently open document.


Extending ScriptWorx - SSiteWorx

Sample Usage:
SSiteWorx();

Background:

Launches the SoftLite SiteWorx site management tool.


Extending ScriptWorx - SSpellCheck

Sample Usage:
SSpellCheck();

Background:

Starts a spell check on the currently open document.


Extending ScriptWorx - SStrike

Sample Usage:
SStrike();

Background:

Inserts the HTML code necessary for creating struck-out typefaces on a web page.


Extending ScriptWorx - SStyleSheet

Sample Usage:
SStyleSheet();

Background:

Launches the "Format using Style Sheets" dialog box for linking external style sheets into web pages.


Extending ScriptWorx - STable

Sample Usage:
STable();

Background:

Launches the visual table designer for creating HTML tables in the currently open document.


Extending ScriptWorx - STidyToCSS

Sample Usage:
STidyToCSS();

Background:

Converts HTML document formatting to Cascading Style Sheets.


Extending ScriptWorx - STidyToXML

Sample Usage:
STidyToXML();

Background:

Converts an HTML document into an XML document.


Extending ScriptWorx - STidyToXHTML

Sample Usage:
STidyToXHTML();

Background:

Converts an HTML document into an XHTML document.


Extending ScriptWorx - STile

Sample Usage:
STile();

Background:

Presents all active editing windows on screen simulatenously, with a 'tiled' effect.


Extending ScriptWorx - STimestamp

Sample Usage:
STimestamp();

Background:

Inserts a timestamp into the current document.


Extending ScriptWorx - STransitions

Sample Usage:
STransitions();

Background:

Formats an HTML document with page transitions for use with Microsoft Internet Explorer.


Extending ScriptWorx - SUnderline

Sample Usage:
SUnderline();

Background:

Inserts HTML code neccessary in a document to produce text with an underlined typeface.


Extending ScriptWorx - SUndo

Sample Usage:
SUndo();

Background:

Undoes the last action performed using the editor.


Extending ScriptWorx - SUpdateScriptWorx

Sample Usage:
SUpdateScriptWorx();

Background:

Launches the ScriptWorx update facility for downloading updated files for ScriptWorx.


Extending ScriptWorx - SValidate

Sample Usage:
SValidate();

Background:

Launches the integrated HTML Validator tool for checking the syntax of HTML documents.


Extending ScriptWorx - SWBMPConvert

Sample Usage:
SWBMPConvert();

Background:

Launches the image conversion utility for converting normal bitmaps to the wireless bitmap format.


Scripting the Interface - Predefined Functions

Extending ScriptWorx - Predefined Objects

Objects

Notes: Using Objects

App object
This object provides access to the main interface, such as screen positions and tools.

Editor object
This object represents the text editor that is currently active.

OpenDlg object
Exposes standard Windows "Open" dialog to the script.

SaveDlg object
Exposes standard Windows "Save" dialog to the script.


Scripting the Interface - Introduction

Extending ScriptWorx - Predefined Objects

Usage of pre-defined objects.

For each object covered in this help file, there are properties and methods given in the format:

  • property
  • method

To use a property or method, you can use the following syntax:

object.property =

or

object.method();

It is essential to end every line in the script with a semi-colon. If you fail to do this, you may receive a script error or the script may not run at all.


Scripting the Interface - AppObject

Extending ScriptWorx - Predefined Objects

App Object: Properties and Methods

Properties
Caption | Changes the titlebar text of the application.
Height | Height of the application window (pixels)
Left | Position x pixels from the left screen edge
Top | Position x pixels from the top screen edge
Width | Width of the application window (pixels)
Methods
BringToFront | Brings the main window to the front of the screen
Close | Closes the window but leaves the application running


Scripting the Interface - Dialogs

Extending ScriptWorx - Predefined Objects

OpenDlg, SaveDlg Object: Properties and Methods

Properties
DefaultExt | Sets the default file extension (do not include a period)
Filename | The selected file in the dialog's file list
InitialDir | Changes the default directory of the dialog
Title | Sets the caption in the title bar
Methods
Execute | Displays the file selection dialog


Scripting the Interface - Editor Object

Extending ScriptWorx - Predefined Objects

The Editor Object: Properties and Methods

Properties
Font.Name | Specifies editor font (String)
Font.Size | Specifies the size of the editor font (Integer)
GutterWidth | Sets width of gutter in pixels (Integer)
HideScrollbars | Toggles scrollbar visibility (Boolean: True, False)
LineHeight | Height of a line in pixels (Integer)
SelText | Text selected in the editor (String)
TemplatesType | TagTemplates (Custom, Delphi, C++ Builder, Clipper)
UndoLimit | Sets the number of possible undo actions (Integer)
Wordwrap | Wraps text at a given value (Boolean: True, False)
Methods
CutToClipboard | Cut selected text to clipboard (x)
CopyToClipboard | Copy selected text to clipboard (x)
Clear | Empties editor of all text
ExportToHTML(s) | Ouput a color-coded representation of code to file
ExportToRTF(s) | Ouput a color-coded representation of code to file
GetSource.Insert(s) | Inserts text at current position
ShowGoToLineDialog | Shows the jump-to-line dialog
ShowSearchDialog | Shows the find dialog
ShowReplaceDialog | Shows the find and replace dialog
TextAtCursor | Returns text directly below cursor
Lines.Add(s) | Adds text at end of the document
Lines.Delete(i) | Deletes a line of text from the document
Lines.LoadFromFile(s) | Loads a file from disk
Lines.SaveToFile(s) | Saves a file to disk
PasteFromClipboard | Paste text from the clipboard
SelectAll | Select all the text in the editor