fScanX Automator Action: Copy Documents
This example creates an application which scans a document to a temporary file, prints it, and deletes it.
Start by creating an application workflow. First we want to get a unique file name, in a location that the system will periodically clean out. Find and add the "Run Shell Script" action (by typing its name into the search field then dragging it into the workflow area), configuring it with the script as shown below:
Add the fscanx action and configure it (probably choosing to "Show this action when the workflow runs" from the "Options" menu).
Next we will tell the Preview application to open the scanned document, and send it the command-P shortcut to get it to print the document. Find and add the "Run AppleScript action, and configure it with the script shown:
Finally, we want to delete the temporary file. (The system would eventually clean it up, but we do it right now to be neat.) Find the "Run Shell Script" action again, and add it again at the end, configuring it with the script shown, and making sure to select "as arguments" for the input style:
Save this, and you have an application that lets you quickly copy a document.
Alternatives that don't work (or don't work well)
This workflow not only has the most steps of any developed so far, but it is the result of some trial and error. There are other approaches that should work, but are not useful. The information that follows is not needed to use this example, but might be of interest if you're trying to learn more about Automator and scripting.
There is a "Print Images" action that should be ideal for this, but it has several problems:
You should be able to use a simpler AppleScript that just tells Preview to print the document. But Preview will not show the print settings dialog. (It will ignore the "with dialog" option.)
You can use a simple AppleScript to ask Adobe Reader to print the document, and Reader will display the print dialog and nicely close its window after printing. But in Adobe Reader X, the print dialog is a user-interface abomination that not only hides your printer options, but chides you if you try to access them.
© 1996-2020 Scott Ribe.