Mac Developer Library

Developer

Foundation Framework Reference NSScriptExecutionContext Class Reference

Options
Deployment Target:

On This Page
Language:

NSScriptExecutionContext

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. More...

Inheritance


Conforms To


Import Statement


import Foundation @import Foundation;

Availability


Available in OS X v10.0 and later.
  • Returns the shared NSScriptExecutionContext instance.

    Declaration

    Swift

    class func sharedScriptExecutionContext() -> NSScriptExecutionContext

    Objective-C

    + (NSScriptExecutionContext *)sharedScriptExecutionContext

    Return Value

    The shared NSScriptExecutionContext instance, creating it first if it doesn’t exist.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • Returns the top-level object for an object-specifier evaluation.

    Declaration

    Swift

    var topLevelObject: AnyObject?

    Objective-C

    @property(retain) id topLevelObject

    Return Value

    The top-level object for an object-specifier evaluation.

    Discussion

    For applications, this object is automatically set to the application object, but can be set to some other container object.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • Sets the top-level object for an object-specifier evaluation.

    Declaration

    Swift

    var topLevelObject: AnyObject?

    Objective-C

    @property(retain) id topLevelObject

    Parameters

    anObject

    The top-level object for an object-specifier evaluation.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • Returns the top-level container object currently being tested in a “whose” qualifier.

    Declaration

    Swift

    var objectBeingTested: AnyObject?

    Objective-C

    @property(retain) id objectBeingTested

    Return Value

    The top-level container object currently being tested in a “whose” qualifier. Returns nil if such an object does not exist.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

    See Also

    – setObjectBeingTested:
    containerIsObjectBeingTested (NSScriptObjectSpecifier)

  • Sets the top-level container object currently being tested in a “whose” qualifier to a given object.

    Declaration

    Swift

    var objectBeingTested: AnyObject?

    Objective-C

    @property(retain) id objectBeingTested

    Parameters

    object

    The top-level container object currently being tested.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • Returns the top-level container object for an object specifier (encapsulated in an NSRangeSpecifier object) that represents the first or last element in a range of elements.

    Declaration

    Swift

    var rangeContainerObject: AnyObject?

    Objective-C

    @property(retain) id rangeContainerObject

    Return Value

    The top-level container object for an object specifier (encapsulated in an NSRangeSpecifier object) that represents the first or last element in a range of elements.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • Sets the top-level container object for a range-specifier evaluation to a give object.

    Declaration

    Swift

    var rangeContainerObject: AnyObject?

    Objective-C

    @property(retain) id rangeContainerObject

    Parameters

    container

    The top-level container object for a range-specifier evaluation.

    Discussion

    Instances of NSRangeSpecifier contain object specifiers representing the first or last element in a range of elements, and these specifiers are evaluated in the context of container.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.