Trying to get my head around an NSGenericException/Apple Event error
Trying to get my head around an NSGenericException/Apple Event error
- Subject: Trying to get my head around an NSGenericException/Apple Event error
- From: email@hidden
- Date: Sat, 22 Dec 2007 15:41:10 +0100
I cannot reproduce this problem myself, but I've been getting a lot of bug
reports lately that all boils down to the same thing: an
NSGenericException raised by an Apple Event returning an -1708 error. The
Apple event is sent to iTunes using ScriptingBridge. According to the docs,
-1708 means "<reference> doesn't understand the <commandName> message". Yet
I don't think there's anything wrong with the code, it works fine over here
and for some 90% of the end users. (I'm catching these exceptions, but since
I need the result of those Apple events it doesn't help much...)
A typical exception looks like this: Apple event returned an error. Event =
'hook'\'Srch'{ '----':'obj '{ 'want':'cLiP', 'from':'obj '{ 'want':'cSrc',
'from':'null'(), 'form':'indx', 'seld':1 }, 'form':'indx', 'seld':1 },
'pTrm':'utxt'("Beck"), 'pAre':'kSrR' }
(That 'from':'null'() thing looks a little suspicious...)
The code that throws this exception is:
track_array = (SBElementArray *)[libraryPlaylist searchFor:theArtist only :
'kSrR']; //only artists
(...where libraryPlaylist = [[[[[iTunes sources ] objectAtIndex:0]
libraryPlaylists] objectAtIndex:0] retain] )
Similar exceptions are thrown for other operations as well, for example when
retrieving user playlists, so it's not just the search part causing
problems.
Any ideas? Could the problem be these users have multiple sources/library
playlists in iTunes? If so, how do I find the main source/library playlist
without explicitly asking the user for it?
_______________________________________________
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