2017-04-15 2 views
0

私のsdefには、 "Any"タイプのパラメータを受け付けるコマンドがあります。スクリプトでNSAppleEventDescriptorからCocoa Scriptingオブジェクトを評価

、私は、スクリプトオブジェクトへの参照渡し:

<NSAppleEventDescriptor: 'obj '{ 'form':'ID ', 'want':'Subi', 'seld':10900, 'from':'obj '{ 'form':'ID ', 'want':'Elem', 'seld':10900, 'from':null() } }>

:パラメータをフェッチするとき、私のコマンドハンドラのコードで

tell application "myApp" 
    set theArg to first subItem of appElement -- appElement is an element of the app object 
    myCommand theArg 
end 

を、私は戻って、このようなオブジェクトを取得します

今、私はそれを "theArg"の実際のスクリプティングオブジェクトを表すNSObjectに解決したいと思います。それ、どうやったら出来るの?私はNSAppleEventDescriptorに、テキスト、数値、ファイル参照などの単純な型以外の評価関数は見つかりません。

答えて

0

私はもう一度mentioned hereの専用機能が必要です。それと

@interface NSScriptObjectSpecifier (NSPrivate) 
+ (id) _scriptingSpecifierWithDescriptor:(NSAppleEventDescriptor*) descriptor; 
@end 

、私はその後、私のオブジェクトを取得するにはobjectsByEvaluatingSpecifierを起動した上でNSScriptObjectSpecifierを取得します。

関連する問題