Package-level declarations

This package contains all essentials and common functionality for scripting.

Types

Link copied to clipboard

This interface is implemented by all classes that serve as builders for an execution of some operation. For every implementation of a template, there is typically an accompanying function that will allow for template argument functions to be called within the scope of the template instance object.

Link copied to clipboard

This exception is thrown when a function is executed from a location in the code where it should not be used.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FILE])
annotation class Import(val paths: String)

A file annotation to import one or more scripts into the current script.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FILE])
annotation class MinVersion(val version: String)

A file annotation to require a minimum version of NSScript. Script compilation will fail if the version requested is greater than the version of the engine.

Link copied to clipboard
abstract class NSScript(val ctx: ScopeContext) : ScriptScope

The base class which is extended by the script engine to execute an NSScript in. This class is also the root ScriptScope and provides the ScopeContext object where ScopeContext.path is the current directory from where the script was executed.

Link copied to clipboard

Exception used to wrap and more easily trace exceptions that occur in the API. This exception is handled and unwrapped by the script engine, so it should not be used in scripts.

Link copied to clipboard
interface ScriptScope

This interface is implemented by all classes that represents the scope of a script.

Link copied to clipboard
interface Settings

This interface is implemented by classes that provide access to settings for scripts in the form of key-value pairs. The settings provided are mostly retrieved from properties files that can be used to specify global settings for NSScript.

Functions

Link copied to clipboard
fun env(name: String): String?

Alias of System.getenv to retrieve the value of an environment variable.

Link copied to clipboard
fun exit(exitCode: Int): Nothing

Alias of exitProcess to kill the script engine process with a given exitCode.