Re: set the clipboard not available in in some apps (like Word)
Re: set the clipboard not available in in some apps (like Word)
- Subject: Re: set the clipboard not available in in some apps (like Word)
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 12 Dec 2004 14:21:48 -0800
On 12/12/04 2:04 PM, "Paul Berkowitz" <email@hidden> wrote:
>> I am willing to add a handler that treats Word as a special case, if I
>> know of some way to place a variable of class Unicode Text into the
>> selection of the front document in Word 2004. In other words, given
>> set theString to "Can you place me now" as Unicode Text
>> is there ANY way to get that into the selection of the front Word
>> document?
>
> Yes. Here's a workaround. Ask the user to click a checkbox or button if they
> intend to paste into Word (so as not to create unnecessary activity for
> other users). If so then add on (after
>
> set theString to "Can you paste me now ¥?" as Unicode text
> set the clipboard to theString
> )
>
> tell application "Microsoft Word"
> set newDoc to make new document
> set content of text object of newDoc to theString
> set selection's selection end to ((end of content of newDoc's text
> object) - 1) -- extends selection to end
> copy object selection
> close newDoc saving no
> end tell
>
>
> Now you can paste it into Word.
Or if you want to replace the selection (or insert at the cursor) of the
front document by script, as you asked, then it's much easier and not
clunky:
set theString to "Can you paste me now ¥?" as Unicode text
tell application "Microsoft Word"
set content of text object of selection to theString
end tell
--
Paul Berkowitz
_______________________________________________
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