If you have used Windows systems you might have found its ability to print a selection of text to be rather useful, and may wish for this feature to be in OS X. Unfortunately, Apple does not have this as an option by default; however, Apple does support the creation of custom services using Automator, and if needed, you can make one that will allow you to do this, and then bind it to a hotkey so you can quickly invoke it.
- Open Automator and create a new Service workflow, and then ensure the input at the top of the workflow is “text” from “any application.”
- Locate and drag the “New Text File” action to the workflow area, and have it save the input as a file with a unique name (e.g., “tempFile.txt”) in the “Downloads” folder (or another folder of your choice).
- Drag the Print Finder Items action to the workflow area below this first action.
- Drag the “Move Finder Items to Trash” action as the last one in the sequence.
When this is done, save the entire workflow with a name like “Print Selected Text,” and it should now be available in the Services submenu of either the Apple menu, or the contextual menu, when you select some text in a document.
Selecting the service in this list will reveal an “Add Shortcut” button, which when clicked will allow you to enter a hotkey of your choice for the service. I recommend you use something like Control-Option-Command-P, since these modifier keys are all in-line and easy to press, and are likely not used by most other applications so the chance of conflicts from hotkey overlap should be minimal.
When done, go to a program where you can select text, highlight a selection, and then press the hotkey or choose the service from the Services menu to print the highlighted text.
Please allow me to point out a limitation : to be printed, the text must be in one block. If there is a paragraph, no print.
Sorry, George, I don’t quite agree there. In TextEdit, it works fine for me. However, if I make several selections within a document (by holding Cmd while dragging the mouse), it prints them right under each other (like: it hasn’t noticed that there were paragraph in between, because it never received the print command for such). But in Tex-Edit Plus, it acts as if the paragraph didn’t exist, i.e. it prints what’s coming below stuck to what’s on top, without even a space. So things seem to vary according to the application, according to how_it_ treats paragraphs internally.
I find neat that it enables you to print the selected names of (single, unfortunately) items, such as, say, the name of a single file in the Finder, or the title of a single podcast in iTunes.
Topher: a neat feature, thanks, but the printouts are slightly primitive. Is there a way to retain the original document’s formatting (fonts, styles etc.) and to set up some margins, or at least to force this service to access the standard Print dialogue with all its features before running off to the printer?
Tingo sorry, but in particular in TextEdit it does not work for me.
I’m in 10.6.8 — maybe a relation there?
I am in 10.9.4.
I have an older machine running 10.9.4, but I don’t print from it. So cannot confirm, sorry.
Anyway it’s a nice, useful tip.
When creating the service, in New Text File, choose rtf rather than Same As Input Text. This gives a nicely formatted result. Now how to choose the font….. Ideas?
When creating the service, choose
Service receives selected rich text in any application
New Text File use Rich text (rtf/rtfd, convert if needed)
This allows selection of graphics as well as formatted text to be printed, in the original font.
Thanks, Ephraim. Works fine in 10.9.4, but not in 10.6.8 (incompatible versions of workflows saved by Automator, apparently)