NSTextView, unicode, Applescript and Mail
NSTextView, unicode, Applescript and Mail
- Subject: NSTextView, unicode, Applescript and Mail
- From: Nick Morris <email@hidden>
- Date: Sun, 5 Oct 2003 20:27:49 +0100
Hi,
The problem: Unicode text (Japanese characters) in an NSTextView
(theTextView) is passed to Mail via an Applescript in the program....
('theContents' is set first for reasons in other sections of the
program)
[theScript setString:[NSString stringWithFormat:@"set theContents to
\"%@\"\n", [theTextView string]]];
[theScript appendString:@"tell application \"Mail\"\n"];
[theScript appendString:@"activate\n"];
[theScript appendString:@"set the new_message to make new outgoing
message at beginning of every outgoing message\n"];
[theScript appendString:@"tell new_message\n"];
[theScript appendString:@"set the content to theContents\n"];
[theScript appendString:@"end tell\n"];
[theScript appendString:@"make new OLD message editor at beginning of
every OLD message editor\n"];
[theScript appendString:@"set outgoing message of last OLD message
editor to new_message\n"];
[theScript appendString:@"end tell\n"];
mailScript = [[NSAppleScript alloc] initWithSource:[NSString
stringWithString:theScript]];
result = [mailScript executeAndReturnError:&scriptErr];
All works great with text such as 'This is some text' but as soon as I
start trying to pass the Japanese characters I get '??' in Mail.
Any thoughts?
Thanks in advance.....
Nick
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.