Introduction to Automator Services


About Automator Services

I’ve previously written about how to automate your Mac to do almost anything using Automator calendar alarms and how to use Services to clear up your Desktop. Services are workflows accessed from contextual menus.
Contextual menus can be found by Secondary-click > Services on a file, text, or in an application or in the application menu via Application > Services. Services are always available in any relevant application, including Finder; Automator doesn’t have to be running for services to work.
While it’s possible to create workflows, applications, and folder actions to accomplish many of the same tasks, the always on nature of Services makes them convenient for small or repeated tasks without breaking up your workflow.
Find services in application menus.
Services receive input in any or in specific applications. This input can be in the form of text, dates, images, documents, and more. Automator uses actions to execute tasks and act on the selected input. Actions can be stacked and contain numerous variables, creating endless and easily customizable output.
Select files to perform the same action on all of them at once.
Services are toggled on and off in System Preferences > Keyboard > Shortcuts > Services. There are more than just Automator services to find there, though. All services for all applications can be accessed here. If the services menus are getting cluttered, shut some off. Click the checkbox next to a service to turn it on again.
Manage services in System Preferences.
If an Automator service isn't working or you just don't have a use for it, it can be deleted from the Services folder in Users > [USERNAME] > Library > Services.
Delete or rename services in the Library folder.

1. Create a Service to Rename Files and Folders

In a previous tutorial, I explained how to use Automator to batch rename files and folders with a user-created Automator application. I’ll show you the process of creating an Automator service to perform the same function. The service will be different than the application, in that it will always be available in the Services contextual menu.
Open Applications > Automator and choose Service when prompted to create a new Automator document. In the Actions sidebar, select Files and Folders and then Rename Finder Items.
Select Service when creating a new Automator workflow.
Tip: You can narrow down the list of actions with the search field in the Actions sidebar.
Drag the Rename Finder Items action to the main workflow pane.

Find the correct action by browsing or searching.
Automator will prompt you to add a Copy Finder Items action before Rename Finder Items. This will preserve the files with their original names and change the names of the copies. While you can choose to add this safety net action to your workflow, it isn’t necessary.
Automator will prompt you to make copies of items if they will be changed or destroyed.
At the top of the workflow, tell Automator what input to look for and where. Because this service will edit filenames, select Files and Folders in Finder. Decide what should be changed about the filename.
I want to add a date to my files, but you can also choose to makes filenames sequential, change the filename from uppercase to lowercase, and more. If any of your changes will create identical filenames, consider adding another Rename Finder Items action to your workflow to number your files.
This action receives files as input in Finder.
Customize the action options. In this case, decide which date to add, date created vs. date modified, the date format, and where the date will be added to the filename.
Customize the action. Use the options to create a new filename format.
Save the workflow and give it a meaningful name, like Add Date to Filename. The service will be available from the contextual services menus when one or more files are selected in Finder.

2. Create an Automator Service to Resize Images (Without Opening an Image Editor)

This service can really speed up image editing and is useful if you need a lot of images with the same dimensions, for instance in app or web development, or if you just want to shrink your images before uploading them to social media.
Open Automator and choose Service when prompted to create a new Automator document, just as before. In the Actions sidebar, select Photos and then Scale Images.
Search for Scale Images or locate it in Photos.
Drag the Scale Images action to the main workflow pane. Automator will prompt you to add a Copy Finder Items action before Scale Images, as it did when we were renaming files. This will make a copy of your original images before they are resized.
Whether you want to preserve the original images depends on how you’re using your images. If you’d like to keep the originals, click Add.
Because Automator is changing the images, it prompts you to make copies.
Check the input and output options at the top of the workflow pane. This service will receive Image Files in Finder.
Next decide how you would like your images scaled and to what size. Automator allows the creation of similar workflows, so you won’t be tied to just one size.For example, if you commonly scale images to three sizes create three separate services.
Make sure the service is looking for image files in Finder and that you set a size for the new images.
When you’re satisfied, save the new service. If you are making several services for different image sizes, give the services unique names so you can later tell your scaling services apart. The Scale Image service will be available anytime one or more images are selected in Finder.

3. Create an Automator Service to Take a Screenshot of a Finder or Application Window

This is a service I use a lot, because I often need screenshots of just the active window. I used to rely on third-party applications to get the job done, but Automator can handle this, too.
Open Automator and again choose Service when prompted to create a new Automator document. In the Actions sidebar, select Utilities and then Take Screenshot.
Select the Take Screenshot action.
Drag the Take Screenshot action to the main workflow pane. The input options will be a little different for this service. At the top of the workflow pane, set the input to No Input in Any Application. This service doesn’t need you to do anything for it to be triggered in the Services menu.
Set the type of screenshot to Interactive, and select Choose Window under options. Set the destination folder for the new screenshot. If the destination folder isn’t present when the service runs, it will create a new folder in the location you specified.
This service doesn't need to receive any input.
Save the service when you’re done. The Take Screenshot service will be available in the application menu for any application.
Unlike the two services above, it isn’t necessary to select a file before activating the service. Instead, when the Take Screenshot service runs, you will be prompted to select a window for the screenshot. The cursor will become a small camera, and the selected window will be grayed-out on hover. Click the window to grab a screenshot of just that window.

4. Create an Automator Service to Count Characters, Words, and Paragraphs

This service take a bit more effort than the others, but it’s useful for quickly learning how many characters and words are in a block of text. It will also count paragraphs, but I’ve found that the service has trouble nailing down an exact number of paragraphs for web-formatted text.
Open Automator and choose Service when prompted to create a new Automator document. In the Actions sidebar, select Utilities and then Run AppleScript.
Drag the Run AppleScript action to the main workflow pane.
Drag the Run AppleScript action to the main workflow pane. At the top of the workflow pane, tell the service to look for selected Text in Any Application.
Because it will count characters in text, the service will receive text input.
Tip: Secondary-click menus may work different in web app text and document editors. If you can’t spot the services menu in your browser when using an online editor, check whether the editor app has a character or word count tool.
In the Run AppleScript action, paste the following into the text field:
on run {input, parameters}
set TextSelection to input as string
set numChars to the number of characters of TextSelection
set numWords to the number of words of TextSelection
set numPara to the number of paragraphs of TextSelection
set theResult to "The text selection contains:" & return
set theResult to theResult & numChars & " characters" & return
set theResult to theResult & numWords & " words" & return
set theResult to theResult & numPara & " paragraphs"
display dialog theResult buttons {"OK"} default button 1 with icon note
on error errmsg number errnum
display dialog errmsg & " [" & errnum & "]" buttons {"OK"} default button 1 with icon stop
end try
return input
end run
Paste the code into the Run AppleScript text field.
Save the service and give it a name. The character counter service will be available from either the secondary-click contextual menu or in the application menu when text is selected in any application.


Though intimidating at first sight, Automator is a simple tool for automating and customizing small, recurring tasks.
Stacking actions allows you to create general to specific services, and with AppleScript, the sky’s the limit with Automator.


Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.


Copyright @ 2013 KrobKnea.

Designed by Next Learn | My partner