引数名でタイプを返します
-(NSString *)typeForArgumentWithName:(NSString *)name:
解説
引数名でタイプを返します。
返り値
( NSString * )
コマンド引数のタイプ
引数
( NSString * )name
キー
フレームワーク
Foundation
クラス
NSScriptCommandDescription
Instance Methods
使用可能
10.0
参照
例文
// Apple Scriptコマンド -(NSNumber *) retCommand:(NSScriptCommand *)sCommand { //スクリプトコマンド辞書 NSDictionary *dicWithNumber = [NSDictionary dictionaryWithObjectsAndKeys: @"supp",@"AppleEventCode", @"NO",@"Optional", @"NSNumber<Int>",@"Type",nil]; NSDictionary *dicArguments = [NSDictionary dictionaryWithObjectsAndKeys: dicWithNumber,@"withNumber", nil]; NSDictionary *dicScriptControll = [NSDictionary dictionaryWithObjectsAndKeys: @"Test",@"AppleEventClassCode", @"sadd",@"AppleEventCode", dicArguments,@"Arguments", @"NSScriptCommand",@"CommandClass", @"long",@"ResultAppleEventCode", @"NSNumber<Int>",@"Type", nil]; //スクリプトコマンド記述作成 NSScriptCommandDescription *scd = [[NSScriptCommandDescription alloc] initWithSuiteName:@"test" commandName:@"ScriptControll" dictionary:dicScriptControll ]; NSNumber * number = (NSNumber *)[[sCommand evaluatedArguments] objectForKey:@"withNumber"]; NSScriptCommand *sc = [scd createCommandInstance]; NSLog([NSString stringWithFormat:@"%@",[[sc commandDescription] typeForArgumentWithName:@"withNumber"]]); return number; }