commandDescriptionWithAppleEventClass:andAppleEventCode:
イベントクラスとコマンドのコードのスクリプトコマンド定義を返します
-(NSScriptCommandDescription *)commandDescriptionWithAppleEventClass:(unsigned long)eventClass: andAppleEventCode:(unsigned long)commandCode:
解説
イベントクラスとコマンドのコードのスクリプトコマンド定義を返します。
返り値
( NSScriptCommandDescription * )
スクリプトコマンド定義
引数
( unsigned long )eventClass
イベントクラス
( unsigned long )commandCode
コマンドコード
フレームワーク
Foundation
クラス
NSScriptSuiteRegistry
Instance Methods
使用可能
10.0
参照
- commandDescriptionsInSuite:
- registerCommandDescription:
例文
- (IBAction)myAction:(id)sender; { //スクリプトコマンド辞書 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 ]; NSScriptSuiteRegistry *sRegistry =[NSScriptSuiteRegistry sharedScriptSuiteRegistry]; NSScriptCommandDescription *scmd ; [sRegistry registerCommandDescription:scd]; scmd = [sRegistry commandDescriptionWithAppleEventClass:'Test' andAppleEventCode:'sadd' ]; NSLog([NSString stringWithFormat:@"%@",[scmd description]]); }