Returns the active document. See the for details.
Path to application executable.
Path currently displayed in the local file list.
Sets/gets the current view.
Allowed values are:
1 - vwEditSource 2 - vwPreview (browse) 3 - vwDesign
See the for details.
Tab index of current document.
Number of open documents.
Filename of application executable, including path.
Height of main window.
Instance handle of the application.
Handle to the main window.
Returns True if the application is ColdFusion Studio, False if HomeSite.
Left (x-coordinate) of main window.
Specifies whether the resource tab is displayed.
Specifies whether the results tab is displayed.
Top (y-coordinate) of main window.
Returns a string containing the application name and version
Sets or returns the width in pixels, of the main application window. You can use this property with the Height property to investigate the size of the main window as well as to resize the window.
Allowed values are:
1 - Normal 2 - Minimized 3 - Maximized
procedure BringToFront;
Brings the main window to the front of other applications.
procedure BrowseText(sText, BaseHREF: OleVariant);
Displays the passed text in the internal browser. The BaseHREF
parameter is used to interpret relative paths. For local files, BaseHREF
should be the folder the file is in.
function CloseAll(wbPromptToSave: WordBool): WordBool;
Closes all open documents. If wbPromptToSave
is True, the user will be prompted to save any changes. Returns True if successful (that is, the user didn't cancel if wbPromptToSave
is True).
Execute a specific command based on its CommandID. See the "Table of CommandID Values" for details.
function ExtractFileName(const wsFile: WideString): WideString;
Returns only the file portion of the passed filename.
function ExtractFilePath(const wsFile: WideString): WideString;
Returns the path of the passed file (includes trailing `\').
Retrieves a specific application setting based on a SettingID. See the "Table of SettingID values" for details.
function GetImageSize(const wsImageFile: WideString; var nHeight, nWidth: Integer): WordBool;
Retrieves the size of the passed image. Returns False on error.
function GetRelativePath(const wsBaseURL, wsFolderURL: WideString): WideString;
Returns the relative path of a folder give a base URL. For example,
Returns "products/".
function GetTabIndexForFile(const wsFile: WideString): Integer;
Returns the index in the document tab of the passed file. Returns -1 If the file isn't open.
function GetURL(const wsURL: WideString): widestring;
Retrieves a URL and returns its contents.
function GetURLStatus(const wsURL: WideString; var vResponse: OleVariant): Integer;
Returns the HTTP status code for the passed URL. The text of the server response is returned in the second parameter.
procedure HideProgress;
Hides the progress bar.
function HTMLConvertTagCase(const wsHTML: WideString; const wbUpperCase: WordBool): WideString;
Converts the case of the passed HTML string. Doesn't change the contents of SCRIPT, STYLE or COMMENT tags, and doesn't change the case of attribute values.
function HTMLGetAttribute(const wsInTag, wsAttr: WideString): WideString;
Returns the value for a particular attribute of a tag. For example,
HTMLGetAttribute ("<TABLE WIDTH=100>", "WIDTH"
Returns 100.
function HTMLGetTitle(const wsFile: WideString): WideString;
Returns the contents of an HTML file's <TITLE> tag. Note that this only operates on local files.
InputBox(const wsCaption, wsPrompt, wsDefault: WideString): WideString;
Displays a dialog box for obtaining user input.
function IsFileOpen(sFile: OleVariant): WordBool;
Returns True if the passed file is open in the Document tab.
function IsFileModified(sFile: OleVariant): WordBool;
Returns True if the passed file is open in the Document tab and has been modified.
InstallParserScript(const wsScriptFile, wsFileExtAssoc: WideString): WordBool;
Installs a parser (color-coding) script and associates it with the passed list of semi-colon separated file extensions. If an existing parser is assigned to any of these extensions, they are removed from the existing parser and assigned to the new one. The parser script is copied from the passed location to the application \Parsers subdirectory. Returns False on error.
MessageBox(const wsText, wsCaption: WideString; nType: Integer): Integer;
Displays a message dialog box for obtaining a user response. The nType
parameter determines the type of dialog box displayed, and should be a combination of the following sets of values:
MB_ICONINFORMATION = 64 MB_ICONWARNING = 48 MB_ICONQUESTION = 32 MB_ICONSTOP = 16 MB_ABORTRETRYIGNORE = 2 MB_OK = 0 (Default) MB_OKCANCEL = 1 MB_RETRYCANCEL = 5 MB_YESNO = 4 MB_YESNOCANCEL = 3
The function's result will contain the ID of the button that was pressed, which will be one of the following:
IDOK = 1 IDCANCEL = 2 IDABORT = 3 IDRETRY = 4 IDIGNORE = 5 IDYES = 6 IDNO = 7 IDCLOSE = 8
procedure NewDocument(wbUseDefaultTemplate: WordBool);
Creates a new document, optionally from the default template.
function OpenFile(const wsFile: WideString): WordBool;
Opens the passed file, returning True if successful. Note that this will return True if the file is already open. Passing an empty string to OpenFile
will display the "Open File" dialog box, enabling the user select the file(s) to open.
procedure NextDoc;
Moves to the next document in the Document tab. If the last document is showing, wraps to the first.
procedure PreviousDoc;
Moves to the previous document in the Document tab. If the first document is showing, wraps to the last.
procedure Quit;
This method will attempt to exit HS/CFS. It will prompt the user to save any unsaved documents prior to exiting.
procedure RunCodeSweeper;
Runs the CodeSweeper on the active document using the active CodeSweeper. To change the active CodeSweeper, use SetActiveCodeSweeper
.
function SaveAll: WordBool;
Saves all open documents, returning True if successful.
procedure SendToBack;
Sends the main window to the back of other applications.
function SetActiveCodeSweeper(const wsFileName: WideString): WordBool;
Changes the active CodeSweeper format file.
procedure SetActiveResults(resType: TCurrentResultsType);
Sets the active page in the results tab.
Allowed values are:
resSearch resValidator resLinks resThumbnails
Sets a specific application setting based on its SettingID. See the for specific SettingIDs.
procedure SetProgress(nProgress: Integer);
Sets the position of the progress bar in the status area. Allowed values are 1-100.
procedure SetStatusText(sMessage: OleString);
Sets the text to be displayed in the status area.
function ShellToApp(const wsAppFileName: WideString): WordBool;
Executes an external application. Returns True if application launched successfully. Note that command lines may be included in the filename parameter, so this is valid:
Application.ShellToApp("notepad.exe " + Application.ActiveDocument.Filename)
procedure ShellToAppAndWait(const wsAppFileName: WideString);
Same as ShellToApp
but waits for the external program to be closed before returning. Note that the application will be locked until ShellToAppAndWait
returns, so use with caution.
procedure ShowProgress;
Shows the progress bar.
procedure ShowThumbnails(sFolder: OleString);
Shows thumbnails for all images in the passed folder.
procedure StatusError(const wsMsg: WideString);
Displays an error message in the status bar - message will appear on a red background and display for at least 5 seconds.
procedure StatusWarning(const wsMsg: WideString);
Displays a warning message in the status bar - message will appear on a blue background and display for at least 5 seconds.
function TagCase(const wsTag: WideString): WideString;
Changes the case of the passed string based on the "Lowercase all inserted tags" setting in the Options > HTML dialog box. Does not modify the case of attribute values.
procedure Wait(nMilliseconds: Integer);
Pauses for given number of milliseconds. Use Wait
to enable scripts to execute loops yet still allow access to the UI. The JavaScript sample below waits for the user to return to edit source view:
var app = Application; while (app.CurrentView != 1) { app.Wait(100); }
Here's the same code in VBScript:
set app = Application while app.CurrentView 1 app.Wait (100) wend
Without the call to Wait
in the loop, the application will appear locked and the user will be unable to change views.