• 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: Moving Text from TextEdit to Word
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Moving Text from TextEdit to Word


  • Subject: Re: Moving Text from TextEdit to Word
  • From: Michael Terry <email@hidden>
  • Date: Mon, 21 Oct 2002 22:47:37 -0700

On 10/21/02 8:03 PM, "Jeffrey Berman" <email@hidden> wrote:

> I'm having difficulty in what I thought would be a simple process of copying
> text of a TextEdit document into a document in Microsoft Word.

Anything's simple once you know how.

> tell application "TextEdit" to get text of document 1
> tell application "Microsoft Word" to set text of document 1 to result
>
> produces the error message:
>
> Microsoft Word got an error: Can't set every text of document 1 to "boo".
>
> I noticed that the result returned from TextEdit had a class of Unicode
> text. But the same error message occurs even if I coerce the text from
> TextEdit to a string as in:
>
> tell application "TextEdit" to get text of document 1 as string
> tell application "Microsoft Word" to set text of document 1 to result

< s n i p >

tell application "TextEdit" to set x to text of document 1
set x to (x as record)'s <<class ktxt>> as string
tell application "Microsoft Word" to set text of document 1 to x

Yes, the problem is the unicode text, but you didn't coerce it hard enough.
You have to put a lot more effort into it.

> -Jeffrey Berman

M I K E

PS - As ever, those double angle brackets in the code need to be replaced
with bonafide guillemets before compiling: option-\ and shift-option-\ on my
US-English keyboard map.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Moving Text from TextEdit to Word (From: Jeffrey Berman <email@hidden>)

  • Prev by Date: Re: Scripting InDesign 2 to print to file
  • Next by Date: User Name in OS X +
  • Previous by thread: Moving Text from TextEdit to Word
  • Next by thread: Re: Moving Text from TextEdit to Word
  • Index(es):
    • Date
    • Thread