evil format and pure text

Erase evil format from your pure text (Mac)

Ever wish to copy this damn text without these fancy formatting? Me too…

The best way for me would be to have a modifier to standard copy shortcut (CMD-C on Mac). Alt+C is used by color palette, CMD-SHIFT-C by ShiftIt to center windows on my machine. I end up with CMD+SHIFT+X, the Hell of Lazy-Shortcuts-Programmer is waiting for me…

That’s my (double) solution.

Solution 1 : Plain Clip + Automator

This way you can play on Plain Clip 2.0 preference, like removal of trailing whitespace and control characters such as non-breaking spaces (see Plain Clip developer website)

  1. Download Plain Clip
  2. Open Automator
    • Create a service that receives selected text in any application
    • Copy to clipboard
    • Run shell script “open -a /Applications/Plain\ Clip.app” (or the path where you put Plain Clip)
    • Save the “Service_Name” service. By default you’ll find it in /Users/User_Name/Library/Services/Service_Name.workflow
  3. Open Keyboard Preference Panel
    • On the left select Services
    • Select Service_Name in Text
    • Set a shortcut

Enjoy it!

Solution 2 : Only Automator, but it just erases formatting!

  1. Open Automator
    • Create a service that receives selected text in any application
    • Run shell script “cat”
    • Copy to clipboard
    • Save the “Service_Name” service. By default you’ll find it in /Users/User_Name/Library/Services/Service_Name.workflow
  2. Like point 3. before.

“This new service will appear as a shortcut in your right-click contextual menu, by itself or in a Services submenu. And in its real home is in the Application > Services menu. From ‘Services preferences’ there, you can even assign a global keyboard shortcut for it. Finally, should you want to edit it, you’ll find it saved in /Users/User_Name/Library/Services/”

Credits for this solution : http://forums.macrumors.com/showthread.php?t=853638

Lascia un commento