Help with call method and a button

I need to get some information out of an objective C call. I understand the way this is done (post: http://macscripter.net/viewtopic.php?id=15714) but I can’t get a very simple test app to work.

I’ve made an Applescript based test app. I put a button on the window. It’s connected with the usual “on clicked theObject” handler.
I made a class called “testClass” with one method called “doLog”. It should just do an NSLog. (or later a method with return of NSString * like "-(NSString *)returnString;).

I’m using this script:

on clicked theObject
	call method "doLog" of class "testClass"
end clicked

Here’s my entire C class .m file:
#import “testClass.h”

@implementation testClass
-(void)doLog
{
NSLog(@“some log”);
}
@end

I can’t get the method to be called.
When I use “call method” on other objects usually it’s directed at something. Like “call method setLevel of window “main” with parameter 1”. That sets the app’s window’s level, and I see it’s called on the window object. Am I missing a pointer to my “testClass” that tells the script what object to call it on? If so how would I add that part in?

Hi,

without creating an instance you can call only class methods

+(void)doLog .

Ah, OK thanks. That works.