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