Script.Include(Path)

Script.Include(Path) navigates to the file stored at the Path given and executes it.

Notes:

  • This is an absolute path, not relative. We have found the best practice for using this process is to:
    • Include a folder in the DEACOM Addins folder to store your scripts
    • Use the Globals.Addins to create the first portion of the absolute path
    • Use a double backslash (\\) as your folder delimiter after the Globals.Addins portion
      • The first backslash is the JavaScript escape key, followed by the actual backslash
  • Users may want to check the Addins folder path in your deacom.ini file to determine if it ends with a backslash (\) or not.

Applies To

Properties and Methods

None

Available

The .Include(Path) method is available in:

  • 15.03.016
  • All newer builds

Type

Method

Syntax

Script.Include(Path);

Parameters

Parameter

Required

Description

Path

Yes

The full, absolute path to the file to include in your script.

Strongly recommend starting the path with Globals.Addins so that you do not need to edit every script that includes a file when moving it. Please use "\\" as the folder delimiter as DEACOM is stored on Windows servers. The first backslash is the JavaScript escape key, followed by another backslash

Example

//--add this script to any event

 

Event.Base();

Script.include(Globals.Addins + 'js\\myscript.js');

 

/* Expected Prompt Response:

Deacom will navigate to the location in the path and execute the script file

This file is located in the Addins\js folder. This assumes that Globals.Addins ends with a backslash.

If not, then the line would be: Script.include(Globals.Addins + '\\js\\myscript.js');

*/

Keyword Link IconScript Object - Properties and Methods