User Guide
Application Object 215
with (Application) {
sInput = InputBox(VersionText, "What is your name?", "Alex");
sOutput = "I know you, your name is " + sInput + ".";
MessageBox (sOutput, VersionText, 0);
}
}
IsFileOpen
Syntax IsFileOpen(sFile: OleVariant): WordBool;
Description Boolean. Returns True if the passed file is open in the Document tab.
Example function Main(){
sFile = ’D:\\Test\\index.html’;
with (Application){
if (!IsFileOpen(sFile)){
OpenFile(sFile);
}
}
}
IsFileModified
Syntax IsFileModified(sFile: OleVariant): WordBool;
Description Boolean. Returns True if the passed file is open in the Document tab and was
modified.
Example
function Main(){
with (Application){
// Save current file if it is modified
if (IsFileModified(ActiveDocument.FileName)){
ActiveDocument.Save();
}
}
}
InstallParserScript
Syntax InstallParserScript(const wsScriptFile, wsFileExtAssoc: WideString):
WordBool;
Description Boolean. Returns False on error. Installs a parser (color-coding) script and
associates it with the passed list of semicolon-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.