setDirectParameter:
ダイレクトパラメータをセットします
-(void)setDirectParameter:(id)directParameter:
解説
ダイレクトパラメータをセットします。通常このメソッドにオーバーライドしません。
返り値
( void )
なし
引数
( id )directParameter
フレームワーク
Foundation
クラス
NSScriptCommand
Instance Methods
使用可能
10.1
参照
- directParameter
例文
// Apple Scriptコマンド -(NSNumber *) retCommand:(NSScriptCommand *)sCommand { //スクリプト記述用の辞書 NSDictionary *dicSource = [NSDictionary dictionaryWithObjectsAndKeys: @"Myou",@"AppleEventCode", @"NO",@"ReadOnly", @"NSNumber<Int>",@"Type",nil]; NSDictionary *dicSupportedCommands = [NSDictionary dictionaryWithObjectsAndKeys: @"retCommand",@"test.ScriptControll", nil]; NSDictionary *dicMyObject = [NSDictionary dictionaryWithObjectsAndKeys: @"MyOb",@"AppleEventCode", dicSource,@"Attributes", [NSNull class],@"InverseRelationships", @"NSCoreSuite.AbstractObject",@"Superclass", dicSupportedCommands,@"SupportedCommands", [NSNull class],@"ToManyRelationships", @"",@"ToOneRelationships", nil]; NSScriptClassDescription *scDesc = [[NSScriptClassDescription alloc] initWithSuiteName:@"test" className:@"MyObject" dictionary:dicMyObject]; //indexSpecifierを作る NSIndexSpecifier *indexSpecifier = [[[NSIndexSpecifier allocWithZone:[self zone]] initWithContainerClassDescription:scDesc containerSpecifier:nil key:@"orderedDocuments" index:1] autorelease]; NSNumber * number = (NSNumber *)[[sCommand arguments] objectForKey:@"withNumber"]; [sCommand setDirectParameter:indexSpecifier]; NSLog([[sCommand directParameter] className]); return number; }