• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Problem adding albums to iPhoto using Scripting Bridge
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem adding albums to iPhoto using Scripting Bridge


  • Subject: Problem adding albums to iPhoto using Scripting Bridge
  • From: Dalmazio Brisinda <email@hidden>
  • Date: Thu, 4 Dec 2008 20:47:11 -0600

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 (email@hidden)

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:
This email sent to email@hidden


  • Prev by Date: New to Cocoa and Objective C, and I need some basic pointers
  • Next by Date: How does MainMenu.xib get loaded in a Cocoa application?
  • Previous by thread: Re: New to Cocoa and Objective C, and I need some basic pointers
  • Next by thread: How does MainMenu.xib get loaded in a Cocoa application?
  • Index(es):
    • Date
    • Thread