蛙の井戸見聞記 Pretty frog in a well who knows nothing of the great web ocean!

~~ 好奇心は猫をも殺す Curiosity Kills the Cat ~~ ♪欲しいモノ・食べたいモノ・ネットで集めた情報と日々の記録の倉庫♪ Logging my life... Since 2003.12  

さて、ApplescriptStudio

下記にObjective-Cで書いてあるASView.hとASView.mに

 - (void)drawText_x:(float)x y:(float)y n:(float)n;

 - (void)drawText_x:(float)x y:(float)y n:(int)n
{
NSString *aString = [NSString stringWithFormat:@"%d",n];
[offImg lockFocus];
[aString drawAtPoint:NSMakePoint(x,y) withAttributes:nil];
[offImg unlockFocus]
}

を追加すると、

	set obj to view "view1" of window "main"
	call method "drawText_x:y:n:" of obj with parameters {x, y, n}
        call method "display" of obj

で、整数がview1上の希望の座標に書ける。他の文字にしたい場合は、aStringを設定する部分をintや%dから変更すれば良い(はず)。

文字の装飾(色・書体など)を付けたい場合は、このへんが参考になる。