appscript

HomePythonRubyObjC About / Install / Docs / Examples // Tools / Links

Examples

Please note that appscript is no longer developed or supported, and its use is not recommended for new projects.

The following program uses appscript to create a new "Hello World!" document in TextEdit:

#import <Foundation/Foundation.h>
#import "TEGlue/TEGlue.h"
int main(int argc, char *argv[]) {
 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 	
 TEApplication *textedit;
 TEMakeCommand *makeCmd;
 
 textedit = [[TEApplication alloc] initWithBundleID: @"com.apple.textedit"];
 
 makeCmd = [[[textedit make] new_: [TEConstant document]]
 withProperties: [NSDictionary dictionaryWithObjectsAndKeys:
 @"Hello World!\n", [TEConstant text], nil]];
 [makeCmd send];
 
 [textedit release];
 [pool release];
 return 0;
}

Additional examples are included in the subversion repository.

HomePythonRubyObjC

AltStyle によって変換されたページ (->オリジナル) /