• 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
NSAppleScript unicode issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSAppleScript unicode issue


  • Subject: NSAppleScript unicode issue
  • From: Jin Kim <email@hidden>
  • Date: Tue, 21 Jun 2005 02:30:28 -0700

Hi,

I'm trying to add a file to a new playlist with nsapplescript but
am experiencing problem with file path containing unicode.
Any suggestion will be appreciated =)

NSString *playlist = [playlistName stringValue];
NSURL *songURL = [NSURL URLWithString:[[song track] URL]];
NSString *command = [NSString stringWithFormat:
        @"tell application \"iTunes\"\n\
            set new_playlist to make new user playlist\n\
            set name of new_playlist to \"%@\" as string\n\
            add {posix file \"%@\"} to new_playlist\n\
          end tell
        ",playlist,[songURL path]];

    

NSAppleScript *script = [[NSAppleScript alloc] initWithSource:command];
NSDictionary *error;
[script executeAndReturnError: &error];
[script release];

Here's the error code:
<NSCFDictionary 0x551cf90>{
NSAppleScriptErrorNumber = -1700;
NSAppleScriptErrorMessage = iTunes got an error: Can't make some data into the expected type.;
NSAppleScriptErrorRange = <00000076 00000087 >;
NSAppleScriptErrorBriefMessage = Can't make some data into the expected type.;
}
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSAppleScript unicode issue
      • From: Annard Brouwer <email@hidden>
  • Prev by Date: Auto size table column to fit content?
  • Next by Date: Re: Auto size table column to fit content?
  • Previous by thread: Re: Auto size table column to fit content?
  • Next by thread: Re: NSAppleScript unicode issue
  • Index(es):
    • Date
    • Thread