Mac Developer Library

Developer

Foundation Framework Reference NSUserScriptTask Class Reference

Options
Deployment Target:

On This Page
Language:

NSUserScriptTask

The NSUserScriptTask class is an abstract class that is able to run all the scripts normally run by the one of its subclasses, however it ignores the results.. It is intended to execute user-supplied scripts and will execute them outside of the application's sandbox, if any. More...

Conforms To


Import Statement


import Foundation @import Foundation;

Availability


Available in OS X v10.8 and later.
  • init(URL:error:) initWithURL:error: Designated Initializer

    Return a user script task instance given a URL for a script file.

    Declaration

    Swift

    init?(URL url: NSURL, error error: NSErrorPointer)

    Objective-C

    - (instancetype)initWithURL:(NSURL *)url error:(NSError **)error

    Parameters

    url

    The script URL.

    error

    A return by-reference error that specifies any error in loading the script.

    Return Value

    An instance of an NSUserScriptTask subclass or nil if the file does not appear to match any of the known types.

    Discussion

    The returned object will be of one of the specific sub-classes (NSUserUnixTask, NSUserAppleScriptTask, and NSUserAutomatorTask), or nil if the file does not appear to match any of the known types.

    If invoked from a subclass, the result will be that class or nil.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.8 and later.

    See Also

    – scriptURL

  • The URL of the script file.

    Declaration

    Swift

    @NSCopying var scriptURL: NSURL { get }

    Objective-C

    @property(readonly, copy) NSURL *scriptURL

    Return Value

    The URL of the script file.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.8 and later.

Data Types