Adding playlists to iTunes with SB
Adding playlists to iTunes with SB
- Subject: Adding playlists to iTunes with SB
- From: Eddy Hatcher <email@hidden>
- Date: Sat, 24 Nov 2007 12:26:41 +0100
Hi,
I am trying to create a playlist and add it to iTunes using scriptig
bridge. Based on Apples documentation I do the following:
iTunesApplication *iTunes = [SBApplication
applicationWithBundleIdentifier:@"com.apple.iTunes"];
SBElementArray *sources = [iTunes sources];
iTunesSource *librarySource = [sources objectWithName:@"Library"];
SBElementArray *myUserPlaylists = [librarySource userPlaylists];
[iTunes activate];
NSNumber *vis = [NSNumber numberWithBool:TRUE];
NSDictionary *propes = [NSDictionary
dictionaryWithObjectsAndKeys:@"ZZZ", @"name", vis, @"visible", nil];
iTunesPlaylist *myPlaylist = [[[iTunes
classForScriptingClass:@"playlist"] alloc] initWithDictionary:propes];
//NSLog(@"Custom Playlist: %@", [myPlaylist name]);
[myUserPlaylists addObject:myPlaylist];
However, the application goes into debug mode and I am having
difficulties knowing what is going wrong. Am I initializing the custom
playlist with the wrong or to few parameters? Later on I would like to
add a couple of tracks to my playlist.
Any help is highly appreciated
Ed
_______________________________________________
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