Since Automator service workflows are contextual, the input choice also determines when the service will appear on the application’s contextual menu. (1) Input Banner The input bar at the top of an Automator service workflow determines the type of data supported as input to the workflow. The illustration and callouts below describe a simple example Automator service workflow, that moves the selected data from Numbers to a new document in the TextEdit application.įor more information on Services, and how they are created and used, watch this short video.Ĭreating an Automator Service for NumbersĭO THIS ►Begin by creating a new Automator workflow document, choosing Service as the template type for the workflow. You can use Automator to easily create text-based services that can extract, process, and even replace the selected data. With this version, the services component of the application contextual menu becomes active, when text is selected in a table or in a text container on a sheet. Where "my folder action script.applescript" is the name of your saved folder action script and the properties name and path represent the name and path to your monitored folder.Numbers 3.1 adds support for system text services. Set my folder action's scripts's enabled to true Make new folder at (path to desktop) with properties If not (exists of folder attachFolderActionTo) then Set folderActionScript to ((path to me as string) & "Contents:Resources:" & resourceName) as string Set resourceName to "ABC Folder Action.scpt" Property attachFolderActionTo : (path to desktop as text) & nameOfTriggerFolder Property pathToFolderActions : ((path to workflows folder as text) & "Applications:Folder Actions:")
Paste this following code into your new blank AppleScript app that you just created. For purposes of this project, the “ABC” folder location would be on the target computer’s desktop. If the “ABC” folder does not exist on the target computer, it will be created. The purpose of this application would be to copy the Automator workflow file (which will be included within the “Resources” folder of this new application you just created in Script Editor ) that you want attached to the “ABC” folder on any user’s computer, to the necessary “Folder Actions” folder on that computer. In Script Editor.app, create a new blank document then immediately go and save it as an application (I saved mine as “JIMZ Attach Folder Action.app”)
If you really want to “idiot proof” the process, here is option.
How can a system administrator install a Folder Action workflow on several client machines? I haven't found a way to automate this configuration step from the command line. It still needs to be enabled in Finder (Home folder -> right click on the folder -> Selecting 'Folder Action Setup.' from the drop down menu). While the *.workflow/Contents/document.wflow does includes the folderActionFolderPath, copying the workflow from one client to another does not work as the Folder Action does not get enabled. I'm aware that the actual workflow definition gets stored in: /Users//Library/Workflows/Applications/Folder Actions/* While end users could be provided the setup instructions, this approach is prone to errors so I'm looking for a better approach. This workflow needs to be installed / deployed to many client machines in corporate environments. When a file gets created in a folder 'abc', the workflow kicks of and executes a shell script. For a specific use case, I've developed a Folder Action workflow with Automator.