Using JavaScript in HomeSite 4.0, Part I: The Application Object's Methods, Part V | WebReference

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:

The 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:

The Color Coding Tab

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:

boxTypeThe Buttons
The Message Box
0
OK
1
OK, Cancel
3
Yes, No, Cancel
4
Yes, No
5
Retry, Cancel
16
OK (Stop icon)
32
OK (Question icon)
48
OK (Warning icon)
64
OK (Information icon)

The method returns the ID of the button that was pressed:

IDThe Button
1
OK
2
Cancel
3
Abort
4
Retry
5
Ignore
6
Yes
7
No
8
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.

http://www.internet.com

Produced by Yehuda Shiran and Tomer Shiran

Created: September 13, 1999
Revised: September 13, 1999

URL: http://www.webreference.com/js/column48/appmet5.html