Re: Dealing with Japanese filenames??
Re: Dealing with Japanese filenames??
- Subject: Re: Dealing with Japanese filenames??
- From: Jonathan del Strother <email@hidden>
- Date: Tue, 3 May 2005 23:14:07 +0100
On 3 May 2005, at 10:50, has wrote:
Jonathan del Strother wrote:
I'm using Applescript to tell iTunes to add some files to a playlist.
I have the filepaths in Cocoa as UTF8 strings. It handles accented
characters fine, but fails for things like Japanese characters,
complaining that it "can't make some data into the expected type"
I've tried both executing the script directly (via
initWithSource), and writing the script to a file and executing
the file (initWithContentsOfURL) - Both report the same error.
Sounds more like a question for the AppleScript Implementors list,
but anyway...
AppleScript source code uses MacRoman or equivalent encoding.
There's no proper way to specify unicode literals in AS code. That
said, code generation isn't such a good way of doing things;
instead, write a generic script that takes the file data as
parameters to a handler call, then pack your file data into an
Apple event as [e.g.] FSRefs and pass this to your NSAppleScript's
executeAppleEvent:error: method.
Thanks for the suggestions, I'll give it a go. In the meantime, did
you have any snippets of Applescript that handles an FSRef? I've
done very little work in Applescript, and have never even heard of
Apple events before. I'm having trouble finding suitable-looking
examples...
Cheers,
Jon
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden