Hello List,
this is my first post and thats my problem with scriptingBridge. I try to build a time time schedule with iCal and Numbers. the workflow should be, to insert the working time into iCal. at the end of the month I will calculate with Numbers the overall working time from the different projects. so for, i can read all the data from iCal an put them via ScriptingBridge into Numbers.
The problem is, to set the backgroundColor of a cell to the calendar color. that is all what i have so far. this is an example with an green example color
NSArray *nameArray = [NSArray arrayWithObjects:@"Peter", @"Paul" , @"Maria" , nil];
NumbersApplication *numbersApp = [SBApplication applicationWithBundleIdentifier:@"com.apple.iWork.Numbers"];
NSURL *numbersURL = [[NSBundle mainBundle ] URLForResource:@"pixelwg" withExtension:@"numbers"];
NumbersDocument *document = [numbersApp open:numbersURL];
NumbersSheet *sheet = [[[document sheets] lastObject] get];
NumbersTable *table = [[sheet tables] objectWithName:@"stundenTable"];
NumbersColumn *colKunde = [[table columns] objectWithName:@"Kunde"];
for(int index = 0 ; index < [nameArray count] ; index++)
{
//write into cell
[[[colKunde cells]objectAtIndex:index +1] setValue: [nameArray objectAtIndex:index]];
//reference to the backgroundcolor
id color = [[[colKunde cells] objectAtIndex:1] backgroundColor];
//how can i set the backgroundcolor?????? it doesn't work
[[[colKunde cells] objectAtIndex:1] setBackgroundColor:[NSColor greenColor]];
NSLog(@"Color: %@" , color); // her logs the red color from the Numbers document
index < ([nameArray count]-1) ? [colKunde addRowBelow]: nil;
}
You can download this complete demoproject www.ufs-leipzig.de/test/images/Bilder/NumbersTest.zip
here .Anyone with suggestions???
thanks wrongspot