spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column48


Using JavaScript in HomeSite 4.0, Part I

Developer News
OpenOffice 3.2 Lands Amid Critical Changes
Red Hat, IBM Firmly in KVM Virtualization Camp
Red Hat Talks Up Open Source Cloud Plans

The Application Object's Properties, Part I

ActiveDocument Read-only Object

Returns the active document, in the form of an object. As you know, several documents can be open at the same time. However, only one document, the active one, is visible in the editor's window. We'll discuss the ActiveDocument object in our next column.

AppPath Read-only String

Reflects the path to the application executable. In other words, it holds the directory where HomeSite (homesite4.exe) is located. For example, the value of this property could be "D:\PROGRAM FILES\ALLAIRE\HOMESITE4\." Notice that the path is followed by a backslash.

CurrentFolder Read-Write String

Holds the path currently displayed in the local file list. The local file list is displayed on the left hand side of the workplace:

The Local File List

In this example, the value of the CurrentFolder property is "F:\Games." Notice that the path is not followed by a backslash. A script can also change the current path in the local file list by assigning a value to this property.

CurrentView Read-Write Integer (1-3)

Reflects the current view. This property holds one of the following values:

  • 1 (Edit)
  • 2 (Browse)
  • 3 (Design)

If you assign this property any other integer, the operation is ignored. However, if it is assigned a different value type, such as a string, an error is generated. The following image outlines HomeSite's three different modes:

Edit, Browse, Design

The following script can be applied to a button that toggles the current view between Edit and Browse:

var app = Application;
function Main() {
  if (app.CurrentView == 1)
    app.CurrentView = 2 // Browse
  else if (app.CurrentView == 2)
    app.CurrentView = 1 // Edit
}

Notice that this is a read-write property.

http://www.internet.com

Produced by Yehuda Shiran and Tomer Shiran


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

webref The latest from WebReference.com Browse >
Search Engine Optimization: Selecting and Embedding Keywords · Are Google's Language Translation Web Services Ready for Prime Time? · Installing and Using Meeplace, the Business Review CMS
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
IBM DB2 10 for z/OS: Justifying the Upgrade · Living La Vida Colo: Choosing the Right Colocation Facility · FTC Concerns over Social Media Privacy Linger


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

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