The Automator icon appears in the Applications folder. Open another Finder window, then open the Applications folder. The Script Editor icon appears in the Utilities folder. In the Finder, open the Utilities folder in the Applications folder. If you are just using a workflow, you will need to provide files and folders by some other means, such as the Ask For Finder Items. To see Automator commands available to scripts, use Script Editor, included with macOS. When you create an Automator application, at the top of the document it starts with "Application receives files and folders as input", so dragging files and folders onto the application will pass them on to the actions in your application. In my example, I also do a quick check to see if the item is a file, in which case find doesn't need to be used. So your statement runs the find command for each directory (represented by the variable $f) in the passed items, then passes the files found to the touch command. The statement for f in starts a loop, with the variable f being set to an item in the items passed ( In the case of the exec primary, it runs the named utility, replacing with the pathnames. For find, you give it the path of a directory to go into, and you can use an expression that is evaluated for each file found in the directory. Simple Tunnel Screen Sharing with Automator. Automator Actions for XML Processing Pipelines. Enjoy OS X Workflow: Batch Editing Renaming a Long List of Files.
You can look at the find man page (or the man page for any command) to find information about what it does and how to use it. In this roundup we’ve collected 70 of the best Automator resources: actions, workflows and tutorials aimed at designers and bloggers.
I don't use Bash all that much, but some handy web pages are: Again, you should probably take a look at some shell scripting books or documentation to understand at least a little bit about what you are doing, since it is fairly easy to make a mess of things (as you have found out). In shell scripting, you can use various commands with control statements and variables, like any other programming language.