Contents

NSScriptExecutionContext

The context in which the current script command is executed.

Declaration

class NSScriptExecutionContext

Overview

An NSScriptExecutionContext object is a shared instance (there is only one instance of the class) that represents the context in which the current script command is executed. NSScriptExecutionContext tracks global state relating to the command being executed, especially the top-level container object (that is, the container implied by a specifier object that specifies no container) used in an evaluation of an NSScriptObjectSpecifier object.

In most cases, the top-level container for a complete series of nested object specifiers is automatically set to the application object (NSApp), and you can get this object with the topLevelObject method. But you can also set this top-level container to something else (using topLevelObject) if the situation warrants it.

It is unlikely that you will need to subclass NSScriptExecutionContext.

Topics

Getting the current context

Getting and setting the container object

See Also

NSObject Script Support