Hi all,

I've been trying to add an empty album to iPhoto using Scripting Bridge but I just can't seem to get it to work.

Here's what I have:

iPhoto = [SBApplication applicationWithBundleIdentifier:@"com.apple.iPhoto"];
        NSString *albumName = @"My Test Album";
NSDictionary *props = [NSDictionary dictionaryWithObject:albumName forKey:@"name"]; IPhotoAlbum *album = [[[[iPhoto classForScriptingClass:@"album"] alloc] initWithProperties:props] autorelease];
        [[iPhoto albums] addObject:album];

And I get the following error:

2008-12-04 20:35:16.699 MyApp[10677:813] unlockFocus called too many time. 2008-12-04 20:35:16.728 MyApp[10677:813] Apple event returned an error. Event = 'core'\'crel'{ 'kocl':'ipal', 'insh':'insl'{ 'kobj':'obj '{ 'want':'ipal', 'from':'null'(), 'form':'indx', 'seld':'abso'($206C6C61$) }, 'kpos':'end ' }, 'prdt': { 'pnam':'utxt'("My Test Album") } }
Error info = {
    ErrorNumber = -10000;
}

The metaphor I'm using is similar to what the Apple documentation shows for adding a document to TextEdit or calenders to iCal both via Scripting Bridge:

http://developer.apple.com/documentation/Cocoa/Conceptual/ScriptingBridgeConcepts/UsingScriptingBridge/chapter_3_section_7.html#/ /apple_ref/doc/uid/TP40006104-CH4-SW11).

Does anyone have the slightest clue how to get this to work for iPhoto?

Best,
dalmazio

_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to