8 Time-Saving Automator Workflows for Your Mac

mac-automator-tips

Your Mac has a built-in tool called Automator that allows you to save time by automating actions. It’s was around long before other automation tools like Workflow (now Siri Shortcuts) and IFTTT. Using Automator is simple. You don’t have to know how to program to set up your own custom workflows that perform common actions on your Mac. Today we’ll show you some useful, time-saving workflows you can set up on your own Mac. Basics of Setting Up an Automator Workflow When you open Automator from the Applications folder, you’re asked to select the type of document you want to…

Read the full article: 8 Time-Saving Automator Workflows for Your Mac

mac-automator-tips

Your Mac has a built-in tool called Automator that allows you to save time by automating actions. It’s was around long before other automation tools like Workflow (now Siri Shortcuts) and IFTTT.

Using Automator is simple. You don’t have to know how to program to set up your own custom workflows that perform common actions on your Mac.

Today we’ll show you some useful, time-saving workflows you can set up on your own Mac.

Basics of Setting Up an Automator Workflow

When you open Automator from the Applications folder, you’re asked to select the type of document you want to create. Take a look at our Automator introduction for an explanation of each type and example workflows.

Select the type of Automator workflow

Two libraries appear at the far left of the Automator window. Click Actions or Variables to access the corresponding library.

Automator panels on a Mac

Drag the actions (or variables) you want to use to the workflow on the right, putting them in the order you want them run. Actions and variables have settings you can adjust for your workflow.

Once you’ve set up your workflow, go to File > Save to save it in the document format you chose when you created it. If you chose the Workflow document type that runs inside of Automator, you can save it as an Application. And if you chose Application as your document type, you can convert that to a Workflow when saving it.

For each workflow we list here, you’ll always start by creating a new document. If you’re already in Automator, go to File > New Document. Or when you open Automator, click New Document on the initial dialog box.

Then select the type of document you want to create. We suggest a type for each workflow listed here, but you can choose a different one if you want. You may have to adjust the actions you use at the beginning of your workflow to get the input you need.

Workflow panel in Automator on a Mac

1. Batch Rename Multiple Files

Batch Rename workflow as a Service in Automator on Mac

If you often rename multiple files at once, there are several ways to batch rename files on a Mac, including creating an Automator workflow and saving it as an application.

You can also use Automator to create a Batch Rename service. This allows you to select files, right-click on them, and select the Batch Rename service from the Services menu. Be sure to select files or folders from the Service receives selected dropdown list and Finder.app from the in dropdown list above the workflow.

When you visit File > Save and enter a name for the Batch Rename service, it’s saved in the correct place and automatically added to the Services menu.

2. Batch Convert and Resize Images on Your Mac

Batch Convert and Resize workflow as a Service in Automator on Mac

We’ve covered batch converting and resizing images on a Mac by creating an application in Automator.

Again, you can also create a Convert and Resize Images service using Automator that allows you to select the files, right-click on them, and select the Convert and Resize Images service from the Services menu. Be sure to select files or folders from the Service receives selected dropdown list and Finder.app from the in dropdown list above the workflow.

When you open File > Save and enter a name for the Convert and Resize Images service, it saves to the correct place and automatically joins the Services menu.

3. Keep Your Downloads Folder Clean

Folder action in Automator on Mac to keep your Downloads folder clean

The Downloads folder on your Mac can quickly become cluttered. But you can use Automator to automatically clean out old items by moving them to the Trash after a specific number of days.

We describe how to do this in our guide on reducing the size of your Mac backup.

4. Quit All Apps at Once

Application in Automator on Mac to quit all applications at once

While you work, you may not realize how many apps you have open. If your Mac doesn’t have much RAM, you might want to close some apps to free up memory. But closing each app separately is time-consuming.

You can close all apps at once and get a fresh start using an app created using Automator. Follow these steps:

  1. Open Automator and create a new Application document.
  2. Click Actions on the far left.
  3. Go to Library > Utilities.
  4. Drag the Quit All Applications action from the middle section to the workflow on the right.
  5. If you want to see a confirmation box to save open documents before they close, check the Ask to save changes box at the top of the Quit All Applications action box.
  6. To certain prevent apps from closing, click Add below the Do not quit box and select the app you don’t want to quit. Repeat this for each app you want to keep open.
  7. Go to File > Save and save the application where you want to. You can also drag it to the Dock for easy access.

5. Open a Specific Set of Web Pages

Application in Automator on Mac for opening multiple web pages in the default browser

Do you load the same set of pages every time you open your browser? You can do this automatically in your default browser by creating an application in Automator. We show you how to do this as one of the ways you can use Automator with your browser.

The Apple homepage may automatically add itself to the Address list. If you don’t want it, select it and click Remove.

6. Combine Multiple PDF Files

Service in Automator on Mac for combining multiple PDF files into one

Do you often combine multiple PDFs into one file? Normally, you’d need an app or online tool to do that. But you can create a service using Automator that allows you to easily combine multiple PDF files into one.

Follow these steps to create a service that appears in Finder:

  1. Open Automator and create a new Service document.
  2. Select files or folders from the Service receives selected dropdown list and Finder.app from the in dropdown list at the top of the workflow pane.
  3. Click Actions on the far left.
  4. Go to Library > Files & Folders on the far left.
  5. Drag the Get Selected Finder Items action from the middle column to the workflow on the right.
  6. Go back to the Library on the left and click PDFs.
  7. Drag the Combine PDF Pages action from the middle column to the bottom of the workflow. Select whether you want to combine the PDF files by Appending pages or Shuffling pages.
  8. Go to Library > Files & Folders again on the left.
  9. Drag the Move Finder Items action from the middle column to the bottom of the workflow. Select the folder you want to move the resulting PDF file to from the To dropdown list.
  10. To replace an existing file with the one you create, check the Replacing existing files box in the Move Finder Items action box.
  11. Go to File > Save and give the service a name. Your new service is automatically put in the correct place and added to the Services menu.

Now you can select multiple PDF files, right-click on them, and select your new service from the Services menu to combine them.

7. Create a Text File From the Clipboard’s Contents

Application in Automator on Mac to copy Clipboard content into a text file

If you often copy text and paste it into a text file to save it, you can create an application using Automator that will make this a snap.

Follow these steps:

  1. Open Automator and create a new Application document.
  2. Click Actions on the far left.
  3. Go to Library > Utilities on the left.
  4. Drag the Get Contents of Clipboard action from the middle column to the workflow on the right.
  5. Go back to the Library on the left and click Text.
  6. Drag the New Text File action from the middle column to the bottom of the workflow.
  7. Modify the settings for your new text file in the action box, like choosing the File Format, entering the default file name (Save as), and Where to save the file.
  8. Go to File > Save and give the service a name. Your new service is automatically put in the correct place and added to the Services menu.

To use it, select the text you want to save in a text file, then run your new Automator app.

8. Convert Text to an Audio File

Service in Automator on Mac to convert text to an audio file

If you have a lot of text to read, you might want your Mac to read it to you. You can create a service using Automator that converts selected text to an audio file.

Follow these steps:

  1. Open Automator and create a new Service document.
  2. Select text from the Service receives selected dropdown list. Leave the default of any application selected in the in dropdown list at the top of the pane.
  3. Select Actions on the far left.
  4. Go to Library > Utilities on the left.
  5. Drag the Text to Audio action from the middle column to the workflow on the right.
  6. Select the System Voice you want. Use the Play button to listen to the selected voice and see what you like.
  7. Enter a file name for the audio file in the Save As box.

Now you can select text in any program, right-click on the selected text, and select your new service from the Services menu to convert the text to an audio file. The service automatically saves the audio as an AIFF file.

The icon on the file includes a Play button in the middle. Simply click the Play button to listen to the audio file.

Save Yourself Time With Automator on Mac

Automator is free and built into your Mac system. Why not take advantage of it to automate time-consuming and tedious tasks?

You can even create a desktop app from a website using Automator. Experiment with the different actions and variables to come up with your own Automator workflows. We’d love to hear about any useful workflows you create.

Read the full article: 8 Time-Saving Automator Workflows for Your Mac

How to Write a Simple Batch (BAT) File

windows-batch-files

Batch files are the computer handyman’s way of getting things done. They can automate everyday tasks, shorten the required time to do something, and translate a complex process into something anyone could operate. In this article, you’ll learn how to write a simple batch file. You’ll learn the basics of what batch files can do and how to write them yourself. I’ll also provide you with further resources for learning to write batch (BAT) files. How to Write a Batch File in Windows Before going into the details, here is a quick summary Open a text file, such as a…

Read the full article: How to Write a Simple Batch (BAT) File

windows-batch-files

Batch files are the computer handyman’s way of getting things done. They can automate everyday tasks, shorten the required time to do something, and translate a complex process into something anyone could operate.

In this article, you’ll learn how to write a simple batch file. You’ll learn the basics of what batch files can do and how to write them yourself. I’ll also provide you with further resources for learning to write batch (BAT) files.

How to Write a Batch File in Windows

Before going into the details, here is a quick summary

  1. Open a text file, such as a Notepad or WordPad document.
  2. Add your commands, starting with @echo [off], followed by—each in a new line—title [title of your batch script], echo [first line], and pause.
  3. Save your file with the file extension .bat, for example, test.bat.
  4. To run your batch file, double click the BAT file you just created.
  5. To edit your batch file, right-click the BAT file and select Edit.

Your raw file will look something like this:
Test Bat File written in Notepad
And here’s the corresponding command window for the example above:
Test Bast file command line output

If this was too quick or if you want to learn more about commands and how to use them, read on!

Step 1: Create a BAT File

Let’s say that you frequently have network issues; you constantly find yourself on the command prompt, typing in ipconfig and pinging Google to troubleshoot network problems. After a while, you realize that it would be a bit more efficient if you just wrote a simple BAT file, stuck it on your USB stick, and used it on the machines you troubleshoot.

Create a New Text Document

A batch file simplifies repeatable computer tasks using the Windows command prompt. Below is an example of a batch file responsible for displaying some text in your command prompt. Create a new BAT file by right-clicking an empty space within a directory and selecting New, then Text Document.

new_text_file

Add Code

Double-click this New Text Document to open your default text editor. Copy and paste the following code into your text entry.

@echo off

title This is your first batch script!
echo Welcome to batch scripting!
pause

Save As BAT File

The above script echoes back the text “Welcome to batch scripting!”. Save your file by heading to File, Save As, and then name your file what you’d like. End your file name with the added .bat extension — welcome.bat for example — and click OK. This will finalize the batch process. Now, double-click on your newly created batch file to activate it.

welcome_to_batch

Don’t assume that’s all batch scripting can do. Batch scripts parameters are tweaked versions of command prompt codes, so you are only limited to what your command prompt can do. For those unfamiliar with the program, command prompt is capable of quite a lot.

Step 2: Learn the Basics of Batch Scripting

Batch files use the same language as the command prompt. All you’re doing is telling the command prompt what you want to input through a file, rather than typing it out in the command prompt. This saves you time and effort. It also allows you to put in some logic (like simple loops, conditional statements, etc. that procedural programming is capable of conceptually).

@echo: This parameter will allow you to view your working script in the command prompt. This parameter is useful for viewing your working code. If any issues arise from the batch file, you will be able to view the issues associated with your script using the echo function. Adding a following off to this parameter will allow you to quickly close your script after it has finished.

title: Providing much of the same function as a <title> tag in HTML, this will provide a title for your batch script in your Command Prompt window.

cls: Clears your command prompt, best used when extraneous code can make what you’re accessing had to find.

rem: Shorthand for remark provides the same functionality as <!– tag in HTML. Rem statements are not entered into your code. Instead, they are used to explain and give information regarding the code.

%%a: Each file in the folder.

(“.\”): The root folder. When using the command prompt, one must direct the prompt to a particular directory before changing a files name, deleting a file, and so on. With batch files, you only need to paste your .bat file into the directory of your choosing.

pause: Allows a break in the logical chain of your .bat file. This allows for users to read over command lines before proceeding with the code. The phrase “Press any key to continue…” will denote a pause.

start “” [website]: Will head to a website of your choice using your default web browser.

ipconfig: This is a classic command prompt parameter that releases information concerning network information. This information includes MAC addresses, IP addresses, and sub-net masks.

ping: Pings an IP address, sending data packets through server routes to gauge their location and latency (response time).

The library for batch variables is huge, to say the least. Luckily there is a Wikibook entry which holds the extensive library of batch script parameters and variables at your disposal.

Step 3: Write and Run Your BAT File

We’ll create two examples of batch scripts which can simplify your daily online and offline activities.

News Script

Let’s create an immediately useful batch script. What if you wanted to open all your favorite news websites the moment you wake up? Since batch scripts use command prompt parameters, we can create a script that opens every news media outlet in a single browser window.

To re-iterate the batch-making process: first, create an empty text file. Right-click an empty space in a folder of your choosing, and select New, then Text Document. With the text file open, enter the following script. Our example will provide the main American news media outlets available online.

@echo off

start "" http://www.cnn.com
start "" http://www.abc.com
start "" http://www.msnbc.com
start "" http://www.bbc.com
start "" http://www.huffingtonpost.com
start "" http://www.aljazeera.com
start "" https://news.google.com/

The above script stacks one start “” parameter on top of the other to open multiple tabs. You can replace the links provided with ones of your choosing. After you’ve entered the script, head to File, then Save As. In the Save As window, save your file with the .bat extension and change the Save as type parameter to All Files (*.*).

save_as_bat

Once you’d saved your file, all you need to do is double-click your BAT file. Instantly, your web pages will open. If you’d like, you can place this file on your desktop. This will allow you to access all of your favorite websites at once.

File Organizer

Have you been downloading multiple files a day, only to have hundreds of files clogging up your Download folder? Create a batch file with the following script, which orders your files by file type. Place the .bat file into your disorganized folder, and double-click to run.

@echo off

rem For each file in your folder
for %%a in (".\*") do (
rem check if the file has an extension and if it is not our script
if "%%~xa" NEQ "" if "%%~dpxa" NEQ "%~dpx0" (
rem check if extension folder exists, if not it is created
if not exist "%%~xa" mkdir "%%~xa"
rem Move the file to directory
move "%%a" "%%~dpa%%~xa\"
))

Here is an example of the my desktop before, a loose assortment of image files.

assorted_files

Here are those same files afterward.

ordered_files

It’s that simple. This batch script will also work with any type of file, whether it’s a document, video, or audio file. Even if your PC does not support the file format, the script will create a folder with the appropriate label for you. If you already have a JPG or PNG folder in your directory, the script will simply move your file types to their appropriate location.

Automate the Simple Stuff With Batch Scripts

This is just a taste of what batch scripts have to offer. If you need something simple done over and over—whether it be ordering files, opening multiple web pages, renaming files en masse, or creating copies of important documents—you can make tedious tasks simple with batch scripts.

Take things even further by incorporating IF statements into your batch scripts. And if you’re really keen, you may even want to learn PowerShell scripting instead.

Read the full article: How to Write a Simple Batch (BAT) File