Using JavaScript in HomeSite 4.0, Part I: The Application Object's Methods, Part V
Using JavaScript in HomeSite 4.0, Part I
The Application Object's Methods, Part V
InstallParserScript(scriptFullPath, extensions) | Boolean |
Copies the parser script file from the given location to the application's "\Parsers" (usually "D:\Program Files\Allaire\HomeSite4\Parsers") subdirectory, and associates it with the given file extensions. The method's second argument is a semicolon separated list of file extensions, such as "ext1; ext2; ext3"
. If one of the given extensions is already associated with a parser, the new association overwrites the previous parser. Let's take a look at the default "\Parsers" directory:
Now select "Setting..." from the "Options" menu, or just hit the F8 key. Select the "Color Coding" tab to see what files are associated with each parser:
MessageBox(prompt, caption, boxType) | Integer |
Displays a dialog box and prompts the user to click a button. The box has a capion at the top (caption
) and includes a programmable prompt (prompt
) message. There are ten different types of boxes. Each type has predefined buttons and a an optional image. The following table shows an outlines the various message boxes:
boxType | The Buttons | |
OK | ||
OK, Cancel | ||
Yes, No, Cancel | ||
Yes, No | ||
Retry, Cancel | ||
OK (Stop icon) | ||
OK (Question icon) | ||
OK (Warning icon) | ||
OK (Information icon) |
The method returns the ID of the button that was pressed:
ID | The Button |
OK | |
Cancel | |
Abort | |
Retry | |
Ignore | |
Yes | |
No | |
Close |
NewDocument(useDefaultTemplateFlag) |
None |
Creates a new document, optionally from the default template (if useDefaultTemplateFlag
receives a true value). The new document is a standard "untitled" one. If you hand this method a false value (0), the HomeSite opens a blank document.
NextDoc() |
None |
Moves to the next document in the document tab. Moves to the first one if the current file is the last one in the tab.
Produced by Yehuda Shiran and Tomer Shiran
Created: September 13, 1999
Revised: September 13, 1999
URL: https://www.webreference.com/js/column48/appmet5.html