AppleScripts for Pasting Text

contributed by Daiya Mitchell and Paul Berkowitz

Applies to: Word 2008, Word 2004

Use these AppleScripts to Paste Unformatted Text or Paste and Match Destination Formatting, in just a single click, or with a shortcut key.

Use at your own risk; see the Script Caveat

You can also access these functions without scripts by using the Paste Options clipboard, which appears at the end of a paste and lets you choose Keep Text Only, Match Destination Formatting or Keep Source Formatting. The Paste Options clipboard can be turned on and off in Word>Preferences>Edit.

What's the Difference Between These Two Scripts?

Paste Text Unformatted does exactly what it says, and is equivalent to Keep Text Only. The Mac site Tidbits offers a variant solution for Paste Unformatted that handles a problem with the cursor location, which you might prefer.

Paste Text Matching Destination Format will change the underlying font and style, but if individual words are italicized or bold, it keeps those single-word emphases. It also retains hyperlinks and footnotes within the pasted text.

Installing the Scripts

Word 2008: Download the compiled scripts, double-click to open in Script Editor, and resave them into [username]/Documents/Microsoft User Data/Word Script Menu Items. Follow the instructions to assign keyboard shortcuts as you save the scripts.

See here for instructions on installing the scripts in Word 2004. Or, Word 2004 users might prefer the macro equivalents, found here.

Paste Text Unformatted

tell application "Microsoft Word"
paste special (text object of selection) data type paste text

activate
end tell

Download compiled script

Paste Text Matching Destination Format

tell application "Microsoft Word"
paste and format (text object of selection) type format surrounding formatting with emphasis

activate
end tell

Download compiled script