Class

NSScriptObjectSpecifier

An abstract class used to represent natural language expressions. 自然言語表現を表すために使われる抽象クラス。

Declaration 宣言

class NSScriptObjectSpecifier : NSObject

Overview 概要

NSScriptObjectSpecifier is the abstract superclass for classes that instantiate objects called “object specifiers.” An object specifier represents an AppleScript reference form, which is a natural-language expression such as words 10 through 20 or front document or words whose color is red.

The scripting system maps these words or phrases to attributes and relationships of scriptable objects. A reference form rarely occurs in isolation; usually a script statement consists of a series of reference forms preceded by a command and typically connected to each other by of, such as: スクリプティングシステムは、それら単語または言い回しを、スクリプト対応オブジェクトの属性およびリレーションシップと関連付けます。参照形式は孤立状態では滅多に見られません;通常スクリプト平叙文は、コマンドを前に置かれて、そして概して互いにofによって連結される、一連の参照形式からなります、例えば;


get words whose color is blue of paragraph 10 of front document

The expression words whose color is blue of paragraph 10 of front document specifies a location in the application's AppleScript object model—the objects the application makes available to scripters. The classes of objects in the object model often closely match the classes of actual objects in the application, but they are not required to. An object specifier locates objects in the running application that correspond to the specified object model objects. 表現words whose color is blue of paragraph 10 of front documentはアプリケーションのもつAppleScriptオブジェクトモデル — アプリケーションがスクリプトを書く人に利用可能にするオブジェクトそれら — の中のある位置を指定します。オブジェクトモデルの中のオブジェクトそれらのクラスは、しばしば細かい点に至るまでアプリケーションの中の実際のオブジェクトのクラスそれらと一致します、しかしそれらがそうであるのは必須とされません。オブジェクト指定子は、実行中のアプリケーションの中のオブジェクトいくつかの位置を突き止めます、それらは指定されたオブジェクトモデルのオブジェクトに相当します。

Your application typically creates object specifiers when it implements the objectSpecifier method for its scriptable classes. That method is defined by the NSScriptObjectSpecifiers protocol. あなたのアプリケーションが概してオブジェクト指定子を作成するのは、それがobjectSpecifierメソッドをそれのスクリプト対応クラスに対して実装する時です。そのメソッドは、NSScriptObjectSpecifiersプロトコルによって定義されます。

It is unlikely that you would ever need to create your own subclass of NSScriptObjectSpecifier; the set of valid AppleScript reference forms is determined by Apple Computer and object specifier classes are already implemented for this set. If for some reason you do need to create a subclass, you must override the primitive method indicesOfObjectsByEvaluating(withContainer:count:) to return indices to the elements within the container whose values are matched with the child specifier’s key. In addition, you probably need to declare any special instance variables and implement an initializer that invokes super’s designated initializer, init(containerClassDescription:containerSpecifier:key:), and initializes these variables. あなたが独自のNSScriptObjectSpecifierのサブクラスを作成する必要はいつもはありません;有効なAppleScript参照形式の集合はApple Computerによって決定されます、そしてオブジェクト指定子クラスそれらは既にこの集合に対して実装されます。なんらかの理由のためにあなたがサブクラスを作成する必要があるならば、あなたは基本メソッドindicesOfObjectsByEvaluating(withContainer:count:)をオーバーライドして、コンテナ内の要素に対するインデックスを返さなければなりません、それの値は子指定子のもつキーと組み合わされます。加えて、あなたはおそらく何らかの特別なインスタンス変数いくらかを宣言するそしてスーパーのもつ指定イニシャライザ、init(containerClassDescription:containerSpecifier:key:)を発動するイニシャライザを実装して、そしてそれらの変数を初期化する必要があるでしょう。

For a comprehensive treatment of object specifiers, including sample code, see Object Specifiers in Cocoa Scripting Guide. サンプルコードを含む、オブジェクト指定子の網羅的な取り扱いとして、オブジェクト指定子Cocoaスクリプティングガイドで見てください。

Topics 話題

Obtaining an object specifier for a descriptor 記述子に対するオブジェクト指定子を入手する

Initializing an object specifier オブジェクト指定子を初期化する

Evaluating an object specifier オブジェクト指定子を評価する

Getting, testing, and setting containers コンテナを取得、テスト、そして設定する

Getting and setting child references 子参照の取得と設定

Getting and setting object keys オブジェクトキーの取得と設定

Getting evaluation errors 評価エラーを取得する

Getting a descriptor for the object specifier オブジェクト指定子に対する記述子を取得する

Constants 定数

Initializers イニシャライザ

Relationships 関係

Inherits From 継承元

Conforms To 次に準拠

See Also 参照

Object Specifiers オブジェクト指定子