■
さて、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から変更すれば良い(はず)。
文字の装飾(色・書体など)を付けたい場合は、このへんが参考になる。