• 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
Re: Play Playlist in iTunes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Play Playlist in iTunes


  • Subject: Re: Play Playlist in iTunes
  • From: "Michael Ash" <email@hidden>
  • Date: Thu, 2 Oct 2008 00:09:59 -0400

On Wed, Oct 1, 2008 at 10:16 PM, Mr. Gecko <email@hidden> wrote:
> I think I would just use this AppleScript call
> [[[NSAppleScript alloc] initWithSource:[NSString stringWithFormat:@"tell
> application \"iTunes\" to play playlist \"%@\"", [self replace:@"\""
> with:@"\\\"" source:[sender title]]]] executeAndReturnError:nil];
> Works fast enough for me and it would work with " because I use my replace
> function to make it \".

You'll also want to replace \ with \\ (make sure you do this *before*
you replace " with \") and *possibly* some others as well, I'm not
completely familiar with exactly what AppleScript allows in strings.
You may also have problems with non-ASCII characters, as AppleScript
is notoriously Unicode-unsavvy.

Last time I had to do something like this (although it was
considerably more complex), I built a library to make it easy to build
raw Apple Events to mimic AppleScript without the mess that comes with
actually using AppleScript itself. If you want to check it out, you
can find more information about it here:

http://www.cocoadev.com/index.pl?AEVTBuilder

Mike
_______________________________________________

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

References: 
 >Play Playlist in iTunes (From: "Mr. Gecko" <email@hidden>)
 >Re: Play Playlist in iTunes (From: Uli Kusterer <email@hidden>)
 >Re: Play Playlist in iTunes (From: "Mr. Gecko" <email@hidden>)

  • Prev by Date: Re: -[NSScanner scanUpToString:stopString:NULL] - 10.3.9 Crash, due Xcode 3.1?
  • Next by Date: Re: Print report using WebView
  • Previous by thread: Re: Play Playlist in iTunes
  • Next by thread: Re: Play Playlist in iTunes
  • Index(es):
    • Date
    • Thread