Hello,
Would anyone know of way to print the selected text?
Thank you.
Hello,
Would anyone know of way to print the selected text?
Thank you.
Thank you.
No I mean:
Wherever you are, document, web page, etc, just highlight text and run macro to print.
Does ⌘P not work for you?
I have a found a “Print clipboard” script. Out of the box it doesn’t work for me, but maybe that’s because I have no printer here.
Thank you for your answer.
In OSX Cmd-P does not offer ‘selection’ as an option
Without having found the right solution, I think it should be something like this.
You make a selection and trigger the macro.
The macro does this:
Yeah, that’s what the AppleScript basically does.
@ronald, have you tried the AppleScript? On my machine it successfully sends a print job to the printer queue, which means that it would probably work — if I had a printer connected.
You can launch the script with a macro like this:
_[test] Print Selection.kmmacros (1.7 KB)
Missed the AppleScript in the thread. It works but only for text.
No images or formatting.
I have hacked together this from different AppleScripts, which uses TextEdit to print.
I am sure it can be improved.
Keyboard Maestro “Print selection” Macro
Print selection.kmmacros (2.5 KB)
Seems to work nicely
I downloaded the macro and tried it. I highlight the text and graphics I wish to print and trigger the macro yielding “No RTF in clipboard”. So I tried highlighting and copying to the clipboard before triggering. Same result.
Any ideas?
Thx.
Bruce
I forgot to say I was using Firefox. Trying it in Safari, these is no error message but no print action either.
Bruce
Here it works fine with Safari.
Apparently Firefox doesn’t put any RTF to the clipboard, so the message “No RTF in clipboard” was correct.
Here is a very slightly modified version of @JimmyHartington’s script:
Print Selection as RTF or Plain Text.kmmacros (2.4 KB)
If it doesn’t find RTF it will print Plain Text instead. This won’t be very useful for Firefox, but maybe for other apps that don’t output RTF.
For example, this way you can also print a Finder selection as a list of files.
Hi Tom
Nice change.
As I wrote. My script was stitched together from 2 sources and I am by no means an AppleScript expert.
So thanks for improving this macro.
I have twisted the AppleScript to make it work with pictures/screenshots in the System Clipboard as well.
tell application "TextEdit"
activate
make new document at the front
tell application "System Events" to keystroke "v" using command down
print front document without print dialog
delay 1 --added a delay to watch the process
close front document without saving
end tell