X-Git-Url: http://git.ithinksw.org/ITFoundation.git/blobdiff_plain/0d9333bf9f0cfd67f68314fe40b37a0034131c84..922d541053280857031e373eddba3843555859ce:/ITAppleEventCenter.m diff --git a/ITAppleEventCenter.m b/ITAppleEventCenter.m index 1588305..abb1823 100755 --- a/ITAppleEventCenter.m +++ b/ITAppleEventCenter.m @@ -21,7 +21,7 @@ static ITAppleEventCenter *_sharedAECenter = nil; + (id)sharedCenter { - if( _sharedAECenter != nil ) { + if( _sharedAECenter ) { return _sharedAECenter; } else { _sharedAECenter = [[ITAppleEventCenter alloc] init]; @@ -182,6 +182,20 @@ static ITAppleEventCenter *_sharedAECenter = nil; } } +- (NSString *)sendAEWithRequestedArray:(NSArray *)array eventClass:(NSString*)eventClass eventID:(NSString*)eventID appPSN:(ProcessSerialNumber)psn +{ + //Build the send string + NSString *curString = [NSString stringWithFormat:@"{ form:'prop', want:type('prop'), seld:type('%s'), from:'null'() }", [[array objectAtIndex:0] UTF8String]]; + int i; + for (i = 1; i < [array count]; i++) { + NSString *from = [NSString stringWithFormat:@"{ form:'prop', want:type('prop'), seld:type('%s'), from:obj %@ }", + [[array objectAtIndex:i] UTF8String], curString]; + curString = from; + NSLog(@"%@", from); + } + curString = [@"'----':obj " stringByAppendingString:curString]; + return curString; +} - (void)sendAEWithEventClass:(NSString*)eventClass eventID:(NSString*)eventID appPSN:(ProcessSerialNumber)psn {