Re: writing text to MS Word
Re: writing text to MS Word
- Subject: Re: writing text to MS Word
- From: Jeffrey Berman <email@hidden>
- Date: Wed, 01 Jun 2005 15:32:26 -0500
On 6/1/05 2:32 PM, Hudson Barton <email@hidden> wrote:
> I have no doubt you are correct in saying that the text result of a
> shell script is often a unicode string rather than an ascii string.
> Most text editors don't care what it is, but Word X does care. I am
> satisfied that my problem is solved as soon as I have a way to coerce
> unicode strings to ascii strings efficiently. Unfortunately, "set
> blah to result as string" does not coerce from unicode to ascii. The
> "as string" coercion works for lists, but it's not for unicode.
>
> I do have one way of coercing that's not too bad...if you have a
> sense of humor. I write the result of the shell script to a POSIX
> file and then read back the text. By "washing" it through the POSIX
> file, I get an ascii string.
Hudson:
If you have a result of Unicode text, this coercion should work:
set StringText to «class ktxt» of ((result) as record)
You should then be able to use the command:
tell application "Microsoft Word" to set text of window 1 to StringText
-Jeffrey Berman
_______________________________________________
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