MacOS – How to create custom Automator tasks for distribution — OS X 10.10

automatormacos

Problem

I would like to make custom tasks for Automator to send to friends who are learning or even just to make new Automator apps easer to write without having to repeat the same tasks over and over.
For example:
run shell command (uptime) -> speak text -> copy to clipboard

Would it be at all possible to make a task called Uptime and use one task instead of three?

Any help would be appreciated 🙂

Best Answer

Using your example, "For example: run shell command (uptime) -> speak text -> copy to clipboard" and to answer your question, "Would it be at all possible to make a task called Uptime and use one task instead of three?", yes... Simply add one Run Shell Script Action to your Automator Workflow and add the following code:

uptime | pbcopy
pbpaste | say

enter image description here

This pipes the output of uptime to the clipboard and then pipes the content of the clipboard to the say command. The output of the uptime command is still on the clipboard to paste elsewhere, either by additional commands and or using the keyboard and or other normal methods of pasting from the clipboard.

Note: I'm assuming that when you say "use one task instead of three", you're actually referring to an Automator Action, e.g. Run Shell Script, not the number of commands written into that on Action.