blue check column
automator-actions.com gray to white fillAutomator Actions for Mac OS X Tiger
Automator Workflow Additions 1.0

Workflow Design Examples

Choose an example:   Batch Workflows Add, Remove & Execute Workflows Dynamic Folder Workflows

Dynamic Folder Workflows

This example demonstrates how the location for new folders, copied files and moved files can be dynamically created.

In this example two Workflows are used to build an Internet photo gallery containing images of varying sizes:

  • Create New Photo Gallery Folders Workflow: this Workflow creates three folders for Thumbnails, Enlargement and Full Size Enlargements images. The Workflow locates the three folders inside a Gallery folder that has a date appended to its name.
  • Make Photo Gallery Images Workflow: this Workflow processes the images – resizes and saves them as jpegs ­– and then moves them into the folders created by the other Workflow.

Whenever the Create New Photo Gallery Folders Workflow is run, the locations of the folders it creates are saved into a global saved result. This ensures that whenever the "Make Photo Gallery Images" Workflow runs, images are moved into the right location (folders).

This example uses the Save Result, New Folder Inside Result Folder and Move Finder Items to Result Folder Actions.

Create Dynamic Folders Workflow – Create New Photo Gallery Folders

Workflow Description
This Workflow takes a base folder – specified by the user – and saves it in a saved result. It then creates a gallery folder, using the base folder saved result to set the location. A new saved result is then created with the gallery folder. The gallery folder saved result is used to create three folders: Thumbnails, Enlargements and Full Size Enlargements. The location of each folder is saved into separate global saved results.

Example Description
Here is a description of what each Action does.

Create Dynamic Folders Workflow
Click for enlargement
  1. The base folder specified by the user is passed to the next Action.
  2. The base folder is saved into a saved result called "Base Web Gallery Folder". Note: This is not a global saved result as it is only accessed in this Workflow.
  3. A new ‘Gallery’ folder is created at the location of the first folder found in the "Base Web Gallery Folder" saved result – i.e. the base folder specified in step 1. The passed items are ignored and the new folder is passed to the new action.
  4. The new folder is renamed to include the date. The renamed folder is passed to the next Action.
  5. The renamed Galley folder is saved into a saved result called "New Gallery Folder". Note: This is not a global saved result as it is only accessed in this Workflow.
  6. A new ‘Thumbnails’ folder is created at the location of the first folder found in "New Gallery Folder" saved result – i.e. the Gallery folder specified in step 3. The passed items are ignored and the new folder is passed to the new action.
  7. The ‘Thumbnail’ folder is saved as a global saved result entitled "Folder – Thumbnail Folder – Used with Make Photo Gallery Images". This saved result is used by the "Make Photo Gallery Images" Workflow in step 10.
  8. A new ‘Enlargements’ folder is created at the location of the first folder found in "New Gallery Folder" saved result – i.e. the Gallery folder specified in step 3. The passed items are ignored and the new folder is passed to the new action.
  9. The ‘Enlargements’ folder is saved as a global saved result entitled "Folder – Enlargements Folder – Used with Make Photo Gallery Images". This saved result is used by the "Make Photo Gallery Images" Workflow in step 7.
  10. A new ‘Full_Size_Enlargements’ folder is created at the location of the first folder found in "New Gallery Folder" saved result – i.e. the Gallery folder specified in step 3. The passed items are ignored and the new folder is passed to the new action.
  11. The ‘Full_Size_Enlargements’ folder is saved as a global saved result entitled "Folder – Full Size Enlargements Folder – Used with Make Photo Gallery Images". This saved result is used by the "Make Photo Gallery Images" Workflow in step 4.

This Workflow would be best saved as a plug-in for use in the Script Menu. This would make it executable from the Script menu on the right-hand side of the menu bar.

Using Dynamic Folders Workflow – Make Photo Gallery Images

Workflow Description
This Workflow takes the Finder items (image files) selected by the user and saves them into a saved result. The selected Finder items are then passed to an external Workflow where they are processed and then returned as a new set of files (Full Size Enlargements). The returned files are then moved to the appropriate folder using a global saved result to set the location for the files. The saved result containing the Finder items is opened and passed to another external Workflow where the images are processed and then returned as a new set of files (Enlargements). The returned files are moved to the appropriate folder using a global saved result to set the location for the files. The open, process and move files repeats one more time (for Thumbnails).

Example Description
Here is a description of what each Action does.

Using Dynamic Folders Workflow
Click for an enlargement
  1. The Finder items the user has selected are passed to the next Action.
  2. The Finder items are saved into a saved result called "Original Image Files". Note: This is not a global saved result as it is only needed in this Workflow.
  3. The Finder items are passed to the external Workflow called "Make Full Size Enlargements". The "Make Full Size Enlargements" Workflow passes the new image files to the next Action.
  4. The "Full Size Enlargements" image files are moved to the location of the first folder found in the "Folder – Full Size Enlargements Folder – Used with Make Photo Gallery Images" saved result.
  5. The "Original Image Files" saved result is opened and passed to the next Action. The items passed from the previous action are ignored.
  6. The result from the previous Action is passed to the external Workflow called "Make Enlargements". The "Make Enlargements" Workflow passes the new image files to the next Action.
  7. The "Enlargement" image files are moved to the location of the first folder found in the "Folder – Enlargement Folder – Used with Make Photo Gallery Images" saved result.
  8. The "Original Image Files" saved result is opened and passed to the next Action. The items passed from the previous action are ignored.
  9. The result from the previous Action is passed to the external Workflow called "Make Thumbnails". The "Make Thumbnails" Workflow passes the new image files to the next Action.
  10. The "Thumbnail" image files are moved to the location of the first folder found in the "Folder – Thumbnail Folder – Used with Make Photo Gallery Images" saved result.

This Workflow would be best saved as a plug-in for use in the Finder. This would make it executable from the menu that appears when you control-click a Finder item.