On Wed, Oct 1, 2008 at 10:16 PM, Mr. Gecko <[EMAIL PROTECTED]> wrote:
> I think I would just use this AppleScript call
> [[[NSAppleScript alloc] initWithSource:[NSString stringWithFormat:@"tell
> application \"iTunes\" to play playlist \"[EMAIL PROTECTED]"", [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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to