## DuESF

The Duduf ExtendScript Framework.
by RxLaboratory and Duduf.
WARNING: all objects marked deprecated will be removed in the version 1.1.0 of the framework.

Version:
  - 1.0.0
Author:
  - Nicolas Dufresne and contributors
Copyright:
  - 2021 Nicolas Dufresne, RxLaboratory
License:
  - GPL-3.0
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with this program. If not, see http://www.gnu.org/licenses/.

View Source DuAEF_Duik_api.jsxinc, line 101

### Example

    // Encapsulate everything to avoid global variables!
    // The parameter is either undefined (stand alone script) or the panel containing the ui (ScriptUI)
    (function(thisObj)
    {
         // Include the framework
         #include "DuESF.jsxinc";

         // Running the init() method of DuAEF is required to setup everything properly.
         DuESF.init( "YourScriptName", "1.0.0", "YourCompanyName" );

         // These info can be used by the framework to improve UX, but they're optional
         DuESF.chatURL = 'http://chat.rxlab.info'; // A link to a live-chat server like Discord or Slack...
         DuESF.bugReportURL = 'https://github.com/RxLaboratory/DuAEF_Dugr/issues/new/choose'; // A link to a bug report form
         DuESF.featureRequestURL = 'https://github.com/RxLaboratory/DuAEF_Dugr/issues/new/choose'; // A link to a feature request form
         DuESF.aboutURL = 'http://rxlaboratory.org/tools/dugr'; // A link to the webpage about your script
         DuESF.docURL = 'http://dugr.rxlab.guide'; // A link to the documentation of the script
         DuESF.scriptAbout = 'Duduf Groups: group After Effects layers!'; // A short string describing your script
         DuESF.companyURL = 'https://rxlaboratory.org'; // A link to your company's website
         DuESF.rxVersionURL = 'http://version.rxlab.io' // A link to an RxVersion server to check for updates

         // Build your UI here, declare your methods, etc.

         // This will be our main panel
         var ui = DuScriptUI.scriptPanel( thisObj, true, true, new File($.fileName) );
         ui.addCommonSettings(); // Automatically adds the language settings, location of the settings file, etc

         DuScriptUI.staticText( ui.settingsGroup, "Hello world of settings!" ); // Adds a static text to the settings panel
         DuScriptUI.staticText( ui.mainGroup, "Hello worlds!" ); // Adds a static text to the main panel

         // When you're ready to display everything
         DuScriptUI.showUI(ui);

         // Note that if you don't have a UI or if you don't use DuScriptUI to show it,
         // you HAVE TO run this method before running any other function:
         // DuESF.enterRunTime();

    })(this);

# Members

Type: `string`

#### # static aboutURL

The url about the script

View Source DuAEF_Duik_api.jsxinc, line 159

Type: `string`

#### # static bugReportURL

The url for reporting bugs

View Source DuAEF_Duik_api.jsxinc, line 149

Type: `string`

#### # static chatURL

The url for a chat server about the script

View Source DuAEF_Duik_api.jsxinc, line 144

Type: `string`

#### # static companyIcon

An icon for this company

View Source DuAEF_Duik_api.jsxinc, line 184

Type: `string`

#### # static companyName

The name of the company/organisation/individual developping this tool

View Source DuAEF_Duik_api.jsxinc, line 174

Type: `string`

#### # static companyURL

The URL to the company's website

View Source DuAEF_Duik_api.jsxinc, line 179

Type: `Boolean`

#### # static debug

Set to true and enable debug mode if you're a developper

View Source DuAEF_Duik_api.jsxinc, line 115

Type: `string`

#### # static docURL

The url to the documentation of the script

View Source DuAEF_Duik_api.jsxinc, line 164

Type: `string`

#### # static donateURL

The url for donations, support, like...

View Source DuAEF_Duik_api.jsxinc, line 154

Type: `Array.<function()>`

#### # static enterRunTimeMethods

The list of functions to run with `DuESF.enterRunTime`. You can add your own methods here.
They're run after the UI has been created and just before runtime

View Source DuAEF_Duik_api.jsxinc, line 267

Type: `File`

#### # static readonly file

The current DuESF File

View Source DuAEF_Duik_api.jsxinc, line 206

Type: `string`

#### # static forumURL

The url for the forum about the script

View Source DuAEF_Duik_api.jsxinc, line 139

Type: `DuESF.HostApplication`

#### # static host

The host application

View Source DuAEF_Duik_api.jsxinc, line 245

Type: `string`

#### # static readonly HostApplication

The applicatiosns DuESF can be used with.

##### Properties:

Name | Type | Description
--- | --- | ---
`AFTER_EFFECTS` | `string` |
`ILLUSTRATOR` | `string` |
`PHOTOSHOP` | `string` |
`INDESIGN` | `string` |

View Source DuAEF_Duik_api.jsxinc, line 234

#### # static hostVersion

The version of the host application

View Source DuAEF_Duik_api.jsxinc, line 249

Type: `Array.<function()>`

#### # static initMethods

The list of functions to run with `DuESF.init`. You can add your own methods here.
They're run after the settings and translator have been loaded.

View Source DuAEF_Duik_api.jsxinc, line 261

Type: `bool`

#### # static isPreRelease

Is this script a prerelease version? This info is used when checking for updates.

View Source DuAEF_Duik_api.jsxinc, line 199

Type: `Array.<function()>`

#### # static preInitMethods

The list of functions to run with `DuESF.init`. You can add your own methods here.
They're run after the settings have been loaded, but before everything else (especially the translator).

View Source DuAEF_Duik_api.jsxinc, line 255

Type: `string`

#### # static rxVersionURL

The URL to a rxVersion server used to check for updates

View Source DuAEF_Duik_api.jsxinc, line 189

Type: `string`

#### # static scriptAbout

The text about the script

View Source DuAEF_Duik_api.jsxinc, line 169

Type: `boolean`

#### # static readonly scriptFirstRun

True if the script is run for the first time (new or the version has changed since last run)

View Source DuAEF_Duik_api.jsxinc, line 228

Type: `string`

#### # static scriptIcon

An icon for this script

View Source DuAEF_Duik_api.jsxinc, line 134

Type: `string`

#### # static readonly scriptName

The name of the script using this instance of DuESF. Must be set by `DuESF.init`.

View Source DuAEF_Duik_api.jsxinc, line 122

Type: `DuSettings`

#### # static scriptSettings

The settings to store the script specific settings.

View Source DuAEF_Duik_api.jsxinc, line 3148

Type: `DuVersion`

#### # static readonly scriptVersion

The version of the script using this instance of DuESF. Must be set by `DuESF.init`.

View Source DuAEF_Duik_api.jsxinc, line 129

Type: `int`

#### # static readonly State

Enum for states.

##### Properties:

Name | Type | Description
--- | --- | ---
`NOT_SET` | `int` |
`INIT` | `int` |
`RUNTIME` | `int` |

View Source DuAEF_Duik_api.jsxinc, line 212

Type: `DuESF.State`

#### # static state

The current state of the script

Default Value:
  - DuESF.State.NOT_SET

View Source DuAEF_Duik_api.jsxinc, line 222

Type: `string`

#### # static translateURL

A URL where people can help localizing the script

View Source DuAEF_Duik_api.jsxinc, line 194

Type: `DuVersion`

#### # static readonly version

The Current DuESF Version

View Source DuAEF_Duik_api.jsxinc, line 109

# Methods

#### # static delete()

Removes all DuESF parts from memory. Call this if you've updated before you reload DuESF.

View Source DuAEF_Duik_api.jsxinc, line 353

#### # static enterRunTime()

This method has to be called once at the end of the script, when everything is ready and the main UI visible (after any prompt or setup during startup).

View Source DuAEF_Duik_api.jsxinc, line 330

#### # static init(hostApplication, scriptNameopt, scriptVersionopt, companyNameopt)

This method has to be called once at the very beginning of the script, just after the inclusion of DuESF `#include DuESF.jsxinc`

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`hostApplication` | `DuESF.host` |  |  | The host application of the script.
`scriptName` | `string` | <optional> | "DuESF" | The name of your script, as it has to be displayed in the UI and the filesystem
`scriptVersion` | `string` | <optional> | "0.0.0" | The version of your script, in the form "XX.XX.XX-Comment", for example "1.0.12-Beta". The "-Comment" part is optional.
`companyName` | `string` | <optional> | "RxLaboratory" | The name of the company/organisation/individual developping this script.

View Source DuAEF_Duik_api.jsxinc, line 275