Your best friend for file transfer
Fetch
Fetch Help > Using Fetch > More examples of using Automator with Fetch
Fetch includes a number of actions for Mac OS X's Automator, allowing you to create simple workflows that can automate a variety of Fetch tasks.
This topic describes some more examples of time-saving things you can do with Automator and Fetch. If you are not familiar with Automator, you may want to start by reading the introduction to using Automator with Fetch help topic, which also includes simple example workflows for uploading or downloading specific files.
For more details about each action, see the Automator actions help topic.
Automator and the Fetch Automator actions are available only on Mac OS X 10.4 or later.
Advanced Upload Droplet
Create a workflow that consists of an Upload Files action, configured for your favorite upload location, plus any actions you want to take after uploading the files — if you want to automatically change the files' permissions or rename the files after uploading them, add a Set Fetch Item Permissions or a Rename Fetch Items action after the Upload Files action.
Then save the workflow as an application: in Automator, choose File > Save As and choose Application from the File Format pop-up menu.
When you drag files and folders to the droplet, they'll be uploaded to your server automatically and modified according to the other actions that you included.
If you simply want a droplet to upload files to a specific server, and do nothing more, creating a droplet shortcut may be an easier solution than using Automator. See the droplet shortcut help topic for more information.
Control-click In the Finder to Upload
If you're using Mac OS X 10.6 or later, create a new workflow, choosing Service from the template selector. Add an Upload Files action to the workflow and configure it for your favorite upload location. Then save the workflow.
If you're using Mac OS X 10.4 or 10.5, create a workflow that consists of an Upload Files action, configured for your favorite upload location. Then save the workflow as a Finder plug-in: in Automator, choose File > Save As Plug-In, and choose Finder from the Plug-in for pop-up menu.
Now when you Control-click on files and folders in the Finder, you can choose your your saved workflow from the Automator submenu of the contextual menu to upload your files automatically (on Mac OS X 10.5, after you Control-click, choose the More submenu, then the Automator submenu). If you want to automatically change the files' permissions or rename the files after uploading them, add a Set Fetch Item Permissions or a Rename Fetch Items action after the Upload Files action.
Batch Change Permissions
Create a workflow that consists of a Get Selected Fetch Items action, followed by a Set Fetch Item Permissions action. Then select the files whose permissions you want to set in a Fetch transfer window, and run the workflow. While you can batch change permissions using the info window, you cannot set file and folder permissions independently when you do that; with the Set Fetch Item Permissions action, you can.
If you want to recursively change permissions (that is, change the permissions for all the files and folders inside the items you've selected) insert a Get Fetch Folder Contents action before the Set Fetch Items Permissions action, and check the "Repeat for each subfolder found" checkbox. Use with caution, since setting permissions is not undoable.
Batch Rename Files
Create a workflow that consists of a Get Selected Fetch Items action, followed by a Rename Fetch Items action. Select the renaming options you want in the Rename Fetch Items action. Then in a Fetch transfer window, select the files whose names you want to set, and run the workflow. Use with caution, since renaming is not undoable.
Download All Files Created Today
If you have a folder on your server where clients or co-workers put new files for you, you can create a workflow that will check that folder for new files and download them all. Create a workflow with the following actions:
- Get Specified Fetch Items
- Get Fetch Folder Contents
- Filter Fetch Items: Whose "Item Type is File"
- Filter Fetch Items: Whose "Modification Date Is Today"
- Download Fetch Items
Configure the Get Specified Fetch Items action with the server and folder that you want to check, and in the Download Fetch Items, choose the local folder where you want the files downloaded to. If you'd rather download files that were modified in the last week, change the second Filter Fetch Items action's options to be "Modification Date Is within the last week," or any other time period you prefer.
The Get Fetch Folder Contents action gets a list of the contents of the folder. The "Item Type is File" filter action ensures that only files will be downloaded, not the entire folder being checked, or any folders in it.
Delete All Old and Large Files
If you have a folder on your server that often fills up with junk, you could create a workflow that will look in that folder and delete any old, large files to free up space on the server. Create a workflow with the following actions:
- Get Specified Fetch Items
- Get Fetch Folder Contents
- Filter Fetch Items: Whose "Item Type is File"
- Filter Fetch Items: Whose "Modification Date Is More Than a Month Ago"
- Filter Fetch Items: Whose "Size Is greater than 500 KB"
- Delete Fetch Items
Configure the Get Specified Fetch Items action with the server and folder that you want to remove files from. Adjust the time and size values of the second and third filter items as you prefer.
The Get Fetch Folder Contents action gets a list of the contents of the folder. The first Filter Fetch Items action that filters for files is necessary to prevent you from deleting an entire folder accidentally (because it's unlikely you want this workflow to do that).
Since deleting items is not undoable, be very careful when using a workflow similar to this one. If you check the "Ask before deleting" checkbox in the Delete Fetch Items action, you will have a chance to see which files will be deleted and cancel the action.
Print a PDF to a File Server
If you're using Mac OS X 10.6 or later, create a new workflow, choosing Print Plugin from the template selector. Add an Upload Files action to the workflow, and configure it for the server and remote folder where you want the PDFs to be uploaded. Then save the workflow.
If you're using Mac OS X 10.4 or 10.5, create a workflow that consists of an Upload Files action, configured for your the server and remote folder where you want the PDFs to be uploaded. Then save the workflow as a Print plug-in: in Automator, choose File > Save As Plug-In, and choose Print Workflow from the Plug-in for pop-up menu.
Now you can create and upload a PDF document to that server from the Print dialog of any application. In the standard Mac OS X Print dialog, click the PDF button, and choose your saved workflow from the PDF menu. The PDF is created and uploaded automatically. (The PDF uploaded to the server will have the same name as the file you're printing, followed by the .pdf extension.)