# Namespace: $

## $

The $ global object that holds all the functions of openHarmony.
All the classes can be accessed from it, and it can be passed to a different context.

##### Properties:

Name | Type | Description
--- | --- | ---
`debug_level` | int | The debug level of the DOM.
`batchMode` | bool | Deactivate all ui and incompatible functions to ensure scripts run in batch.
`file` | string | The openHarmony base file - THIS!
`getScene` | $.oScene | The harmony scene.
`scene` | $.oScene | The harmony scene.
`scn` | $.oScene | The harmony scene.
`s` | $.oScene | The harmony scene.
`getApplication` | $.oApp | The Harmony Application Object.
`application` | $.oApp | The Harmony Application Object.
`app` | $.oApp | The Harmony Application Object.
`network` | $.oNetwork | Access point for all the functions of the $.oNetwork class
`utils` | $.oUtils | Access point for all the functions of the $.oUtils class
`dialog` | $.oDialog | Access point for all the functions of the $.oDialog class
`global` | Object | The global scope.

### Example

    // To access the functions, first call the $ object. It is made available after loading openHarmony like so:

    include ("openHarmony.js");

    var doc = $.scn;                    // grabbing the scene document
    $.log("hello");                     // prints out a message to the MessageLog.
    var myPoint = new $.oPoint(0,0,0);  // create a new class instance from an openHarmony class.

    // function members of the $ objects get published to the global scope, which means $ can be ommited

    log("hello");
    var myPoint = new oPoint(0,0,0);    // This is all valid
    var doc = scn;                      // "scn" isn't a function so this one isn't

### Classes

oApp
oArtLayer
oAttribute
oBackdrop
oBox
oColor
oColorValue
oColumn
oDatabase
oDialog
oDrawing
oDrawingColumn
oDrawingNode
oElement
oFile
oFolder
oFrame
oGroupNode
oLink
oLinkPath
oList
oMetadata
oNetwork
oNode
oNodeLink
oPalette
oPathPoint
oPegNode
oPieMenu
oPieSubMenu
oPoint
oPreference
oPreferences
oProcess
oProgressDialog
oScene
oScriptButton
oShape
oStencil
oThread
oTimeline
oTimelineLayer
oTool
oToolbar
oUtils
oXml
oPieButton

### Members

#### DEBUG_LEVEL

  Enum to set the debug level of debug statements.

#### directorystring

  The openHarmony main Install directory

### Methods

#### alert(labelText, title, okButtonText)

openHarmony.js, line 219
  Prompts with an alert dialog (informational).

  Name | Type | Description
  --- | --- | ---
  `labelText` | string | optional The label/internal text of the dialog.
  `title` | string | optional The title of the confirmation dialog.
  `okButtonText` | string | optional The text on the OK button of the dialog.

#### alertBox(labelText, title, okButtonText)

openHarmony.js, line 231
  Prompts with an alert dialog with a text box which can be selected (informational).

  Name | Type | Description
  --- | --- | ---
  `labelText` | string | optional The label/internal text of the dialog.
  `title` | string | optional The title of the confirmation dialog.
  `okButtonText` | string | optional The text on the OK button of the dialog.

#### beginUndo(undoName)

openHarmony.js, line 300
  Starts the tracking of the undo accumulation, all subsequent actions are done in a single undo operation.
  Close the undo accum with $.endUndo().

  Name | Type | Description
  --- | --- | ---
  `undoName` | string | The name of the operation that is being done in the undo accum.

  See:
    - $.endUndo

#### browseForFile(text, filter, getExisting, acceptMultiple, startDirectory){Array.<string>}

openHarmony.js, line 254
  Prompts with a file selector window

  Name | Type | Default | Description
  --- | --- | --- | ---
  `text` | string | "Select a file:" | optional The title of the confirmation dialog.
  `filter` | string | "*" | optional The filter for the file type and/or file name that can be selected. Accepts wildcard character "*".
  `getExisting` | string | true | optional Whether to select an existing file or a save location
  `acceptMultiple` | string | false | optional Whether or not selecting more than one file is ok. Is ignored if getExisting is false.
  `startDirectory` | string |  | optional The directory showed at the opening of the dialog.

  ##### Returns:

  Type | Description
  --- | ---
  Array.<string> | The list of selected Files, 'undefined' if the dialog is cancelled

#### browseForFolder(text, startDirectory){Array.<string>}

openHarmony.js, line 269
  Prompts with a folder selector window.

  Name | Type | Description
  --- | --- | ---
  `text` | string | optional The title of the confirmation dialog.
  `startDirectory` | string | optional The directory showed at the opening of the dialog.

  ##### Returns:

  Type | Description
  --- | ---
  Array.<string> | The path of the selected folder, 'undefined' if the dialog is cancelled

#### cancelUndo()

openHarmony.js, line 314
  Cancels the tracking of the undo accumulation, everything between this and the start of the accumulation is undone.

#### confirm(labelText, title, okButtonText, cancelButtonText){bool}

openHarmony.js, line 205
  Prompts with a confirmation dialog (yes/no choice).

  Name | Type | Description
  --- | --- | ---
  `labelText` | string | optional The label/internal text of the dialog.
  `title` | string | optional The title of the confirmation dialog.
  `okButtonText` | string | optional The text on the OK button of the dialog.
  `cancelButtonText` | string | optional The text on the CANCEL button of the dialog.

  ##### Returns:

  Type | Description
  --- | ---
  bool | Result of the confirmation dialog.

#### debug(obj, level)

openHarmony.js, line 140
  The standard debug that uses logic and level to write to the messagelog. Everything should just call this to write internally to a log in OpenHarmony.

  Name | Type | Description
  --- | --- | ---
  `obj` | obj | Description.
  `level` | int | The debug level of the incoming message to log.

#### endUndo()

openHarmony.js, line 323
  Stops the tracking of the undo accumulation, everything between this and the start of the accumulation behaves as a single undo operation.
  See:
    - $.beginUndo

#### getHarmonyUIWidget(name, parentName)

openHarmony.js, line 281
  Gets access to a widget from the Harmony Interface.

  Name | Type | Description
  --- | --- | ---
  `name` | string | The name of the widget to look for.
  `parentName` | string | optional The name of the parent widget to look into, in case of duplicates.

#### getPreferences()

openHarmony.js, line 356
  Gets the preferences from the Harmony stage.

#### log(str)

openHarmony.js, line 158
  Log the string to the MessageLog.

  Name | Type | Description
  --- | --- | ---
  `str` | string | Text to log.

#### logObj(object, debugLevel)

openHarmony.js, line 170
  Log the object and its contents.

  Name | Type | Description
  --- | --- | ---
  `object` | object | The object to log.
  `debugLevel` | int | The debug level.

#### prompt(labelText, title, prefilledText)

openHarmony.js, line 243
  Prompts for a user input.

  Name | Type | Description
  --- | --- | ---
  `labelText` | string | optional The label/internal text of the dialog.
  `title` | string | optional The title of the confirmation dialog.
  `prefilledText` | string | optional The text to display in the input area.

#### redo(n)

openHarmony.js, line 344
  Redoes the last n operations. If n is not specified, it will be 1

  Name | Type | Description
  --- | --- | ---
  `n` | int | The amount of operations to undo.

#### undo(n)

openHarmony.js, line 333
  Undoes the last n operations. If n is not specified, it will be 1

  Name | Type | Description
  --- | --- | ---
  `n` | int | The amount of operations to undo.