I'm tearing my hair out trying to create a new album from a Cocoa Application. In applescript it's a nice simple procedure:
tell application "iPhoto"
new album name "Album"
end tell
But I can't work out how this is done in Cocoa via the Scripting Bridge. I've tried this:
iPhotoApplication *iPhoto = [SBApplication applicationWithBundleIdentifier:@"com.apple.iPhoto"];
iPhotoAlbum *newAlbum = [[[[iPhoto classForScriptingClass:@"album"] alloc] initWithProperties:[NSDictionary dictionaryWithObject:@"Album" forKey:@"name"]] autorelease];
[[iPhoto albums] addObject:newAlbum];
But that had no effect.
Please help!