Application properties

The Application interface supports the following properties:

ActiveDocument 
Access  Read-only 
Type  Document 
Description  Returns a Document object that represents the active document (the document in the active window). This object is similar, but not identical to the object addressed simply as ActiveDocument. Application.ActiveDocument can be assigned to a variable, which will then continue to represent the same document even when it is not the currently active document. However, if ActiveDocument is assigned to a variable, the value of the variable will change if a different document becomes the active document. 
Usage   
JScript  Application.ActiveDocument; 
VBScript  Application.ActiveDocument 
Example 
// SoftQuad Script Language JSCRIPT:
// bring up SaveAs dialog for active document 
Application.ActiveDocument.SaveAs();
// An equivalent form:
ActiveDocument.SaveAs();
 

Application 
Access  Read-only 
Type  Application 
Description  This property returns an Application object that represents the HoTMetaL PRO application. Application and Application.Application are synonymous. 
Usage 
JScript  Application.Application;  
VBScript  Application.Application 
Example 
// SoftQuad Script Language JSCRIPT:
Application.Alert("Hi there");
// You can access all methods and properties of 
// the application object.
Application.Application.Alert(Application.Path);
 

AssetsPath 
Access   Read-only 
Type  String 
Description  Returns the path to the HoTMetaL PRO Assets folder
Usage 
JScript  Application.AssetsPath; 
VBScript  Application.AssetsPath 

CommandBars 
Access  Read-only 
Type  CommandBars 
Description  Provides access to the CommandBars interface. 
Usage 
JScript  Application.CommandBars;  
VBScript  Application.CommandBars 
Example 
// SoftQuad Script Language JSCRIPT:
// get command bar count
Application.Alert(Application.CommandBars.Count); 
 
 

Documents 
Access  Read-only 
Type  Documents 
Description  Returns a Documents object that represents all the open documents. This object can be addressed simply as Documents
Usage 
JScript  Application.Documents;  
VBScript  Application.Documents 
Example 
// SoftQuad Script Language JSCRIPT:
var doc;
var count=Application.Documents.Count;
// Iterate through Documents collection, 
// and print file names
for (x=1; x <=count; x++) {
	doc=Application.Documents.item(x);
	Application.Alert(doc.FullName);
}
 

DropPoint 
Access   Read-only 
Type  Range 
Description  If the current script was run by being dragged-and-dropped or pasted into a document, DropPoint returns a Range object corresponding to the point at which the script was dropped; otherwise, returns a Range object corresponding to the user selection (the same as ActiveDocument.Range). 
Usage 
JScript  Application.DropPoint; 
VBScript  Application.DropPoint 
Example 
// SoftQuad Script Language JSCRIPT:
var rng;
rng=Application.DropPoint;
rng.Text="Script dropped here!";
 

FX 
Access  Read-only 
Type  FX 
Description  Provides access to the FX object, used for creating scripts for the Asset Manager. 
Usage 
JScript  Application.FX;  
VBScript  Application.FX 
Example 
// SoftQuad Script Language JSCRIPT: 
Application.Alert(Application.FX.Path); 
// display the path for the FX directory
 

IsDocumentOpen(Document) 
Access   Read-only 
Type  Boolean 
Description  Returns true if the document represented by the specified Document object is currently open in HoTMetaL PRO. 
Usage 
JScript  Application.IsDocumentOpen(Document_object); 
VBScript  Application.IsDocumentOpen(Document_object) 
Example 
// SoftQuad Script Language JSCRIPT:
// doc2 is a Document object
if (Application.IsDocumentOpen(doc2))
    Application.Alert(doc2.IsValid);
else
    Application.Alert("Document is no longer open.");
 

MacroFile 
Access   Read-only 
Type  String 
Description  Returns the full path to the default HoTMetaL PRO macro file(Macros\hotmetal.mcr). See also Document.MacroFile
Usage 
JScript  Application.MacroFile; 
VBScript  Application.MacroFile 
Example 
// SoftQuad Script Language JSCRIPT:
Application.Alert(Application.MacroFile);
 

Path 
Access  Read-only 
Type  String 
Description  Contains the path to the currently running HoTMetaL PRO application. 
Usage 
JScript  Application.Path;  
VBScript  Application.Path 
Example 
// SoftQuad Script Language JSCRIPT:
// display the path for the HoTMetaL PRO application
Application.Alert(Application.Path);  
 

ProjectDirectory 
Access  Read-only 
Type  String 
Description  Returns the path of the current project.  
Usage 
JScript  Application.ProjectDirectory;  
VBScript  Application.ProjectDirectory 
Example 
// SoftQuad Script Language JSCRIPT: //display the project directory Application.Alert(Application.ProjectDirectory); 
 

Selection 
Access  Read-only 
Type  Selection 
Description  Returns a Selection object that represents the user's selection (which could be the insertion point) in the active document. This object can also be addressed simply as Selection. Application.Selection is evaluated dynamically and always takes its value from the current active document. This is true even when it is represented by a variable. For example, if you define:
var sel=Application.Selection;
and a different document becomes active, a reference to sel will return the user's selection in the new active document. By contrast, a Range object represents the same selection, no matter which document is active.  
Usage 
JScript  Application.Selection;  
VBScript  Application.Selection 
Example 
// SoftQuad Script Language JSCRIPT:
//display selected text
Application.Alert(Application.Selection.Text);  
// insert  PRE element
var select = Application.Selection;
 
select.insertElement("PRE");  
 

Visible 
Access  Read/write 
Type  Boolean 
Description  Determines whether the HoTMetaL PRO application is hidden or visible.  
Usage 
JScript  Application.Visible;  
VBScript  Application.Visible 
Example 
// SoftQuad Script Language JSCRIPT:
Application.Alert("Hide HoTMetaL PRO");
Application.Visible = false;
Application.Alert("Bring it back");
Application.Visible = true;
 

WindowHandle 
Access  Read-only 
Type  Long 
Description  Provides access to the window handle. 
Usage 
JScript  Application.WindowHandle;  
VBScript  Application.WindowHandle 


Right arrow
Next Topic
Left arrow
Previous Topic
Table of contents
Table of Contents

Copyright © SoftQuad Software Inc. 1999