• 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
Adding playlists to iTunes with SB
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Overlapping Views
  • Next by Date: Re: [NSBundle preferredLocalizationsFromArray:] Is the cold war really over?
  • Previous by thread: Re: NSTableView apparently doesn’t respect allowsEmptySelection:NO anymore on Leopard
  • Next by thread: Re: Adding playlists to iTunes with SB
  • Index(es):
    • Date
    • Thread