Re: Can anyone explain Word behavior???
Re: Can anyone explain Word behavior???
- Subject: Re: Can anyone explain Word behavior???
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 04 Mar 2001 15:07:11 -0800
On 3/4/01 2:28 PM, "Bill Planey" <email@hidden> wrote:
>
Anyway (done ranting), has anyone else encountered this weird clipboard
>
problem and actually found a way to make Word copy and paste correctly
>
when running in the background?
>
>
Do I need to do something like setting the copied item to a variable
>
and then invoking the variable in the paste step?
Word has a proprietary clipboard which often seems unavailable from
AppleScript. What would be much more reliable would be to not use the
clipboard at all but just save the information and insert it into the second
document. That's easy enough in basic AppleScript (saving to a variable) for
unformatted text, but it's more difficult for your tables and for styled
text. All the definitions you need _are_ in Word's AppleScript dictionary,
but I've often found that trying to do more intricate things in AppleScript
in Word can be very tricky, and often unreliable, frustrating and
failure-prone. What works perfectly is to learn how to do what you need in
Visual Basic for Word, then use the command 'do Visual Basic "[the VB script
here]" '. I'm sorry that this is not an easy answer, but it's the one that
works. Even the clipboard works perfectly in VB, but using range, etc. is
often better.
--
Paul Berkowitz