Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Easily paste and match style anywhere Web Browsers
Frequently, I will copy something from a formatted web site, but I want what I paste to just match the formatting of where I paste it. Some browsers have an Edit » Paste and Match Style command, but I've found that it frequently doesn't work. This is a speedy workaround that is guaranteed to always work.

Anything that you paste into the address or search bar of any Web browser is automatically converted to plain text. Pasting plain text will always cause it to match the formatting of the destination.

So, to quickly and easily make text match the destination formatting when pasted, just do this:
  • Paste it into the search bar.
  • Copy it back.
  • Paste it into your destination.
You can do this all with a keyboard sequence, of course.

[crarko adds: I tested this, and it works as described. I'd probably use BBEdit for the conversion but this will work too.]
    •    
  • Currently 2.75 / 5
  You rated: 3 / 5 (12 votes cast)
 
[10,621 views]  

Easily paste and match style anywhere | 18 comments | Create New Account
Click here to return to the 'Easily paste and match style anywhere' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Easily paste and match style anywhere
Authored by: arcticmac on Mar 07, '11 07:42:39AM

Another alternative that might be even easier and would work outside a web browser would be to write an applescript something like
do shell script "pbpaste | pbcopy"
Which could then be run from your script menu or your favorite keyboard shortcut program.



[ Reply to This | # ]
Easily paste and match style anywhere
Authored by: pauljlucas on Mar 08, '11 08:15:35AM
I've been using this for years:
#!/bin/sh
pbpaste | pbcopy
osascript -e 'tell application "System Events" to keystroke "v" using command down'
I named the text file "Paste Plain Text", did a chmod +x on it, and put it in ~/Library/Scripts so it shows up in on the Scripts menu. You select the text you want, do a Command+C as normal, then select this script from the menu.
---
- Paul


[ Reply to This | # ]
Easily paste and match style anywhere
Authored by: Anonymous on Mar 07, '11 07:51:27AM

Or even better: if you copy something whilst holding down the "option" key, the old format will be deleted. (So you would press "cmd + option + c" instead of simply "cmd + c"... come to think of it, this should really be a tip on its own ;)

greeting!

Greg



[ Reply to This | # ]
Easily paste and match style anywhere
Authored by: Koninda on Mar 08, '11 06:27:44AM

This doesn't work for me. I'm using a three year old MacBook Pro with 10.6.6. I've reset my System Preferences>Keyboard Shortcuts to the defaults. <Command-Option-c> doesn't put the selected text into the clipboard for me. I've tested copying from and to various combinations of Safari, TextEdit, Word 2004, and Nisus Writer Pro. When I switch to the Finder, and choose Edit>Show Clipboard, it shows the last item that I had copied using the standard <Command-c>. Attempting to paste in any of the above applications just pastes the previous copied text (with attributes), rather than what I attempted to copy with <Command-Option-c>.

What am I missing?



[ Reply to This | # ]
Keyboard combination
Authored by: capacity on Mar 07, '11 08:07:19AM

Why not use the keyboard combo to paste and match style: command-option-shift-V. Also, what browsers does this frequently not work in? I've never encountered a situation in Safari (or any other application besides Word) when this doesn't work.



[ Reply to This | # ]
Keyboard combination
Authored by: rgray on Mar 07, '11 08:33:34AM

+1. This built in key combo seems the easiest and has never failed for me in browsers or any other application.



[ Reply to This | # ]
Easily paste and match style anywhere
Authored by: BHDicaire on Mar 07, '11 08:13:24AM

I'm using TextExpander to automatically paste and match style.

My snippet content is "%clipboard" and my default Snippet Format in Preference is Plain Text.

TextExpander is a great investment, I paid it just with this functionality.

Benoît



[ Reply to This | # ]
Easily paste and match style anywhere
Authored by: squarefrog on Mar 07, '11 08:16:42AM
I created an automator service for this. Then assigned a keyboard shortcut. Instant stripped plain text copy!

on run {input, parameters}
	
	tell application "System Events"
		keystroke "c" using command down
	end tell
	
	delay 0.05
	
	try
		set the clipboard to string of (the clipboard as record)
	on error errMsg
		display dialog errMsg
	end try
	
	return input
end run
The delay is there to allow time for converting to plain text. I now just highlight text and press: cmd+shift+c to copy plain text.

[ Reply to This | # ]
Easily paste and match style anywhere
Authored by: wallybear on Mar 07, '11 08:23:50AM
Just create a keyboard shortcut (I use Spark) that runs the following applescript:

do shell script "pbpaste | pbcopy"
tell application "System Events"
	keystroke "v" using command down
end tell


[ Reply to This | # ]
Easily paste and match style anywhere
Authored by: Anonymous on Mar 07, '11 08:48:01AM

Why not use the key combo "command - option - shift - V" to ensure it overrides the built in paste shortcut?



[ Reply to This | # ]
Repost
Authored by: redfood on Mar 07, '11 08:54:50AM

This is an old hint:

http://hints.macworld.com/article.php?story=20051213055833832



[ Reply to This | # ]
Easily paste and match style anywhere
Authored by: osxpounder on Mar 07, '11 09:29:10AM

Thanks for the hint. This may save me time. Until now, I've copied, switched to TextEdit or TextWrangler, pasted, copied again, then pasted in the other app.

I still might use the text editor detour, however, because it gives me a chance to run a service that removes line breaks (and maybe a service to capitalize words based). I've got keyboard shortcuts for some of those.



[ Reply to This | # ]
Easily paste and match style anywhere
Authored by: auntchilada on Mar 07, '11 09:50:09AM

gormy.



[ Reply to This | # ]
Easily paste and match style anywhere
Authored by: tingo on Mar 08, '11 05:14:11AM

Not sure what I didn't understand here. That's maybe because I see the issue from the reverse side. Pasting from a page in Firefox (my primary browser) into an advanced text editor does not take the style with it, and that's a problem for me because I usually need the original style. So for such tasks I use Safari. I even made a macro to catch the URL in Firefox, launch Safari, paste in the URL box and open the page.



[ Reply to This | # ]
Easily paste and match style anywhere
Authored by: stehkoyeh on Mar 08, '11 02:28:57PM

I can offer another solution:

(1) copy text,

(2) keeping in mind the paragraph or phrase that will immediately precede the text to be pasted, use paste and match style command to insert the text to be pasted within or at the end of that paragraph or phrase. Important Note: Make sure that the text to be pasted ends up as part of the paragraph or phrase.

(3) If the text to be inserted needs to stand alone for any reason, e.g. as a quote, then place it at the end of the destination text and simply place the cursor at the beginning of the text just pasted and use your return key, once or twice as desired. You have your inserted text standing alone and matching style. Again, it is most important to ensure that the inserted text is part of the text immediately preceding it.

Simpler explanations are to be preferred over more complex ones. If the paste and match style command has been deficient all this time I find it hard to believe that Mac would not have "fixed" it. The reason that it hasn't, of course, is that it doesn't need fixing, it requires the user to know the computer. That being said, it would be really nice if the people at Mac explained these things at the outset.



[ Reply to This | # ]
Easily paste and match style anywhere
Authored by: wallybear on Mar 09, '11 12:34:36PM

The problem is that the "Paste with style" is not present in every app. So this hints applies to all those situations.



[ Reply to This | # ]
Easily paste and match style anywhere
Authored by: stehkoyeh on Mar 10, '11 09:12:46AM

Where there is no paste and match style command under Edit or where there is, but it will not work even though the procedure has been followed as I have outlined, then there is no doubt that the Hint offered by the author is an elegant solution to the problem, as are some of the solutions offered in some of the replies.

I personally have never come across an app where it doesn't work one way or another, but clearly, my experience in that regard is limited and I apologize to Nathanator11 (and others) for assuming his Hint might be superfluous when it is clearly not.

Thanks wallybear for pointing that out.

I suggest, however, that one always tries Edit/Paste and Match Style first just in case it works. :- )



[ Reply to This | # ]
Easily paste and match style anywhere
Authored by: asmeurer on Mar 17, '11 09:10:04PM

Doesn't this not work if there are newlines in the text? My solution is to paste it into TextWrangler (which I always have open anyway) and recopy, which converts it to plain text.



[ Reply to This | # ]