Mac Developer Library

Developer

AppKit Framework Reference NSAppleScript AppKit Additions Reference

Options
Deployment Target:

On This Page
Language:

NSAppleScript

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Swift

import AppKit

Objective-C

@import AppKit;

Availability


Available in OS X v10.2 and later.

The Application Kit adds a method to the Foundation framework’s NSAppleScript class to handle rich text source. This method becomes part of the NSAppleScript class only for those applications that use the Application Kit.

For more information, see NSAppleScript in the Foundation Framework API Reference.

  • Returns the syntax-highlighted source code of the receiver if the receiver has been compiled and its source code is available.

    Declaration

    Swift

    var richTextSource: NSAttributedString? { get }

    Objective-C

    @property(readonly, strong) NSAttributedString *richTextSource

    Discussion

    Returns nil otherwise. It is possible for an instance of NSAppleScript that has been instantiated with initWithContentsOfURL:error: to be a script for which the source code is not available, but is nonetheless executable.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.2 and later.