Re: Moving Text from TextEdit to Word
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.