setScriptingProperties:
スクリプトプロパティをセットします
-(void)setScriptingProperties:(NSDictionary *)properties:
解説
スクリプトプロパティをセットします。
返り値
( void )
なし
引数
( NSDictionary * )properties
フレームワーク
Foundation
クラス
NSObject
Instance Methods
使用可能
10.2
参照
- scriptingProperties
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { /* NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys: NSMakeRect(0,0,100,100),@"boundsAsQDRect", [NSNull null] ,@"delegate", [NSNull null] ,@"document", */ NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys: [NSValue valueWithRect:NSMakeRect(0,0,100,100)],@"boundsAsQDRect", [NSNumber numberWithBool:YES] ,@"hasCloseBox", [NSNumber numberWithBool:NO] ,@"hasTitleBar", [NSNumber numberWithBool:NO] ,@"isFloatingPanel", [NSNumber numberWithBool:YES] ,@"isMiniaturizable", [NSNumber numberWithBool:NO] ,@"isMiniaturized", [NSNumber numberWithBool:NO] ,@"isModalPanel", [NSNumber numberWithBool:YES] ,@"isResizable", [NSNumber numberWithBool:YES] ,@"isVisible", [NSNumber numberWithBool:YES] ,@"isZoomable", [NSNumber numberWithBool:NO] ,@"isZoomed", [NSNumber numberWithInt:1] ,@"orderedIndex", @"ttttt",@"title", nil]; [[sender window] setScriptingProperties:dic]; NSLog([[[sender window] scriptingProperties] description]); } // Apple Scriptのadditionコマンド -(NSNumber *) retCommand:(NSScriptCommand *)sCommand { NSNumber *number = (NSNumber *)[[sCommand evaluatedArguments] objectForKey:@"withNumber"]; NSString *string = (NSString *)[[sCommand evaluatedArguments] objectForKey:@"withString"]; NSArray *arr = [NSArray arrayWithObjects: number,string, nil]; return arr; } #pragma mark ACCESSMETHOD -(NSNumber *)source { NSNumber *num = [NSNumber numberWithInt:[myOutlet intValue]]; return num; } -(void)setSource:(NSNumber *)source { [myOutlet setIntValue:[source intValue]]; } @end