Hey all,
I’m currently busy with ASStudio and want to use the call method with parameter (which is an array) in order to get some things done.
This is mainly about the C/ObjC part, handling the array which was send using the call method.
Here’s some code from my Applescript:
set myArray to {100, 200, 300}
set myReturnedString to call method "ReturnMyValue:" with parameter myArray
and the method in C/ObjC:
- (NSString*)ReturnMyValue:(NSArray *)myValues
{
---
Missing code:
I have to work with the incoming array 'myValues', like:
int theCalculatedValue = myValues[0] + myValues[1] / myValues[2];
---
The result should be send back to my Applescript:
return [NSString stringWithFormat:@"%hu", theCalculatedValue];
}
I’ve tried several things, but keep getting errors. The most common error is:
Incompatible types in assignment, whenever I add the following code to my method:
NSArray *myVar[3];
myVar[0] = myValues[1];
This is just an example of what I try to achieve.
I must say that I’m not a programmer at all, and that C/ObjC is very difficult for me.
A brief description of the things that I actually would like to achieve (in the end) can be found here:
http://lists.apple.com/archives/colorsync-dev/2003/May/msg00009.html
(for those who read the article above, I’ve managed to create a colorworld that can do the transformation, so the focus is now on parsing and working with the array)
Thnks in advance for any help on this,
Erik