Sponsored in part by... Freeverse Freeverse, Inc.'s SOUND STUDIO 3.5.5 - Sound Studio is for anyone
who needs to record or edit audio with a professional tool, but at
a consumer price. Perfect for Podcasts, Music, More! Now updated
for OS X 10.5 Leopard. <http://www.freeverse.com/soundstudio>

 [F] TidBITS  / TidBITS  / TidBITS Talk  /

Updated Paste Plain Text AppleScript for Word 2008

[adc448]adc448 (apparently) - 04:12am Mar 30, 2008 PST
via email

Kissell's Applescript serves certain purposes but not others. In my opinion,
it doesn't actually solve the real problem. What I want, and need, is Paste
and Match Style: the pasted text adopts the font and font size of the
destination document/document section, but retains other characteristics
such as italics, bf -- and, perhaps most importantly, footnotes.

Kissell's script strips away all of that, so it has limited utility. Word
enables it in a cumbersome way: Edit>Paste Special>choose Formatted text
(RTF) from menu>click Okay. Probably possible to Applescript that, but I
don't know scripting well enough to try. If someone out there does, the
undying gratitude of thousands will serve as your reward.

[First: Please call me Joe. Second: On my computer, in Word 2008, using the Formatted Text (RTF) option in the Paste Special dialog preserves all the styling of the pasted text, including font and size. Although you can duplicate that feature using AppleScript, you get the same result. On the other hand, if you use the AppleScript equivalent for Styled Text, the pasted text adopts the size of the surrounding text but keeps its font. Attributes like italics are preserved, but footnotes aren't. In short, I know of no way to get precisely the effect you want, because I'm unaware of any way to selectively paste only some, but not all, style attributes - Mac OS X treats them as a bundle. -Joe Kissell]


Mark as Read
  OutlineAll MessagesOlder MessagesOldest MessagesNewest MessagesNewer Messages

Daiya - Apr 1, 2008 1:36 am (#1 Total: 1)  

Reply to this message
 

Photo of Author
Posts: 1
Re: Updated Paste Plain Text AppleScript for Word 2008

I only did a fairly quick test, but I think the Paste Matching Destination Format script here: <http://word.mvps.org/Mac/scripts/PasteTextAS.html> does what adc448 wants. It brings footnotes, retains bold, underline, italic, but changes underlying font and size. The script is a bit hinky about screen refresh--I keep having to scroll to get the text to show up.

In addition, there's a less cumbersome way to get Paste and Match Style--use the Paste Options clipboard (Match Destination Formatting), as described at the same link. I'm not finding that anything in Edit/Paste Special is equivalent to Match Destination Formatting.

Joe, that page also links your script, hope that's fine.

[Yep, cool - and thanks for link. Somehow I missed that option in Word's AppleScript dictionary. It does appear to (approximately) work. -Joe]



  OutlineAll MessagesOlder MessagesOldest MessagesNewest MessagesNewer Messages


 [F] TidBITS  / TidBITS  / TidBITS Talk  / Updated Paste Plain Text AppleScript for Word 2008




Add a message

To add a message to this discussion, you must be a registered user. Enter your email address below. If you have an account associated with the email address you enter, you will be prompted for your password. If not, you'll be able to create a new account with no fuss.

Enter your email address:

Submit