MrAu Posted April 2, 2019 Posted April 2, 2019 (edited) Hi, This workflow adds a File Action to allow for sending a document to your default printer. Eg: send a document to printer, print selected files. It takes an Automator workflow and runs it like so /usr/bin/automator ./print-selected.workflow download here https://github.com/fxjkhr/alfred-workflows/blob/master/print-selected.alfredworkflow Edited October 22, 2019 by MrAu
TomBenz Posted February 1, 2024 Posted February 1, 2024 On 4/3/2019 at 3:26 AM, MrAu said: Hi, This workflow adds a File Action to allow for sending a document to your default printer. Eg: send a document to printer, print selected files. It takes an Automator workflow and runs it like so /usr/bin/automator ./print-selected.workflow download here https://github.com/fxjkhr/alfred-workflows/blob/master/print-selected.alfredworkflow @vitor @Vero Is there a universal action that prints selected content in any application to default printer or open in preview?
Stephen_C Posted February 1, 2024 Posted February 1, 2024 4 hours ago, TomBenz said: Is there a universal action that prints selected content in any application to default printer or open in preview? I'm clearly missing something but, surely, outside Alfred (e.g., in Finder) ⌘P and pressing the spacebar respectively (i.e., no need for Universal Actions)? Inside Alfred (i.e., looking at Alfred's results) see Alfred Preferences → Features → Previews. Stephen
TomBenz Posted February 1, 2024 Posted February 1, 2024 21 minutes ago, Stephen_C said: I'm clearly missing something but, surely, outside Alfred (e.g., in Finder) ⌘P and pressing the spacebar respectively (i.e., no need for Universal Actions)? Inside Alfred (i.e., looking at Alfred's results) see Alfred Preferences → Features → Previews. Stephen Thanks for your reply. Print command doesn't give option to print only selected text in outlook / safari etc. Got this code and Alfred workflow with universal action to achieve my desired outcome. tell application "System Events" keystroke "c" using {command down} end tell tell application "TextEdit" activate set newDoc to make new document tell application "System Events" to keystroke "v" using command down delay 0.2 activate -- Ask the user if they want to print before closing set printResponse to display dialog "Do you want to print the document before closing?" buttons {"Print", "Don't Print"} default button "Print" -- Check the user's response if button returned of printResponse is "Print" then print front document without print dialog end if set saveResponse to display dialog "Do you want to save the document before closing?" buttons {"Save", "Don't Save"} default button "Don't Save" -- Check the user's response if button returned of printResponse is "Save" then set desktopPath to path to desktop folder as text set rtfFileName to "temp_text.rtf" set rtfFilePath to desktopPath & rtfFileName save front document in file rtfFilePath end if -- Close the document without saving it again close window 1 with saving end tell
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now