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
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

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

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

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

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business


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

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