I am starting to work on an application that must expose 1 Applescript command. 
(It's rather challenging to understand and implement.)
I don't understand what is happening with this code: If I have an ivar that is 
global in scope, when the Applescript command is accepted, that ivar won't be 
used. Why would that be ignored at all? What am I missing here?
Chris

For example (code simplified):

@interface...
{
NSString *userName;
}

@implementation...

-(void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
    userName = NSUserName();
}

-(id)performDefaultImplementation
{
NSDictionary * theArguments = [self evaluatedArguments];
NSString *filePath = [self directParameter];

NSNumber *tcNumber = [theArguments objectForKey:@"tcNumber"];
NSString *operationType = [theArguments objectForKey:@"operationType"];
//the globals won't pass in properly when called from script
[self logEventDoc:filePath operType:operationType withTC:[tcNumber longValue]];
return nil;
}


-(void)logEventDoc:(NSString *)docPath operType:(NSString *)opType 
withTC:(long)tcNumber
{
NSString *theCommand = [NSString stringWithFormat:@"SpLogEventEtc %@ %D %@ %@", 
docPath, tcNumber, opType, userName];
//for testing, let's just do our favorite NSLog
NSLog(@"%@", theCommand);
//user name prints as (NULL) !!?? Why not using userName?
}
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to