• 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
Re: writing text to MS Word
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: writing text to MS Word
  • Next by Date: Re: writing text to MS Word
  • Previous by thread: Re: writing text to MS Word
  • Next by thread: Re: Scripting Mail.app suggestions requested
  • Index(es):
    • Date
    • Thread