SHORTCUT to Create, Email, and Print PDF

I'm trying to create a Shortcut automation to create a PDF of a numbers document, email that PDF to someone, and then print that PDF. This is a process that is done every week. I cannot for the life of me figure out how to accomplish this using Shortcuts. Any help is appreciated!

MacBook Pro

Posted on Aug 14, 2022 9:26 AM

Reply

Similar questions

4 replies

Aug 14, 2022 12:09 PM in response to jamesddancer

There are three issues.

  1. A Numbers document must be opened by Numbers and then exported to PDF from within Numbers, and cannot be directly saved as PDF by any tool, including Adobe products.
    1. This can be achieved with relative brief AppleScript using the Numbers AppleScript dictionary
    2. However, there is no means in AppleScript to rotate the PDF into landscape mode for sheets with many columns, and truncating the sheet across many PDF pages is ungainly.
  2. Although one can print the original Numbers document to the default printer, there also is no means to switch to landscape mode from AppleScript, or from the open print panel. Same truncated sheets onto multiple pages problem.
  3. One may be able to pass the full path name of that exported PDF into the Shortcuts or Automator Mail action so it will do the right thing and attach. Haven't tried that yet.


Do you want your Automation as an application that you double-click to run and choose a Numbers document, or a Quick Action where you could select one or more Numbers documents in the Finder and then action would then process them?


By example, here is an AppleScript that prompts you for a Numbers document, changes its extension to PDF, opens that Numbers document, does the export to PDF, and then uses the default printer to print it.


use scripting additions

set f to (choose file of type {"com.apple.iwork.numbers.sffnumbers"} default location (path to desktop))
-- exported pdf will have same path and filename but with pdf extension
set xpdf to (do shell script "zsh -c 'print ${0:a:s/numbers/pdf}' " & POSIX path of f) as POSIX file
l

tell application "Numbers"
	activate
	open f
	
	with timeout of 1200 seconds
		export front document to file xpdf as PDF with properties {image quality:Best}
		print front document without print dialog
	end timeout
	
	close front document
end tell
return


More work would be required for a functional Shortcut or Automator solution. Opening that exported PDF and printing it would eliminate the print line above, and one would have to open the PDF in Apple's Preview and print it from there using the same printing syntax.

Aug 14, 2022 10:15 AM in response to jamesddancer

You may want to create an automator action instead.


First, create a folder where you will save the document. This will be your watch folder. Anything you drop in the folder will be acted upon by the action.


Second, you'll need to ensure that you have Acrobat Distiller installed (Part of Adobe Acrobat Professional).


Finally, open Automator. And do something like the following:


Save the action that you create too!


As you see, when I save a document to my folder "watch folder numbers," it kicks off the process to print the document, save it as a pdf, and attach it to a email message, then automatically send the message.

Aug 14, 2022 11:17 AM in response to jamesddancer

I use a macro app, Keyboard Maestro , to automate many multiclick operations that I do frequently, like this one that opens Safari's Advanced preference pane, turn on (or off) larger font size and select a CSS file to use:



All with only a two key combination: Command+Tab


I've found it to be my most used utility and relied on utility. There are other macro apps in the App Store but I feel that Keyboard Maestro is the most powerful.


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

SHORTCUT to Create, Email, and Print PDF

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.