MotorXP-PM Scripting API
    Preparing search index...

    Interface MotorXP

    Built-in MotorXP object implementing the global appVersion(), include(), require(), readFile(), and writeFile() functions.

    interface MotorXP {
        appVersion(): Version;
        include(path: string): any;
        readFile(path: string): string;
        require(name: string): Object;
        writeFile(path: string, content: string, append?: boolean): boolean;
    }
    Index

    Methods

    • Same as appVersion.

      Returns Version

      Object with major, minor, and build properties.

    • Same as include.

      Parameters

      • path: string

        Path to the script file.

      Returns any

      Result of executing the included file; false if the file does not exist or cannot be opened.

    • Same as readFile.

      Parameters

      • path: string

        Path to the file.

      Returns string

      File contents; an empty string on error.

    • Same as require.

      Parameters

      • name: string

        Path to the module file.

      Returns Object

      Data exported by the module.

    • Same as writeFile.

      Parameters

      • path: string

        Path to the file.

      • content: string

        Contents.

      • Optionalappend: boolean

        Append to the file.

      Returns boolean

      True if writing succeeded.