Capture automatic browser tasks in macOS with Automator


Sidecar in action under macOS Catalina

How often do you perform the same actions on the Mac? Still, you can automate repetitive tasks with a free utility that comes standard with macOS. Automator may seem intimidating, but with a little insight, you can use the tool to do chores on autopilot. Here we show you how to record automatic browser tasks with Automator.

Tip 01: Calendar reminder

A nice exercise to master Automator is this action that allows you to open a certain web page at a specific time. That way the day starts with a cup of coffee and the web pages of, for example, three news sites. You provide the coffee yourself, Automator collects the three web pages for you every morning at nine. To compile this task, open Automator in the folder Utilities or the folder Programs. It goes even faster if you bring up the application from Spotlight. Press Cmd + Spacebar and type Automator in the Spotlight search box and then the app with the logo of the robot will appear. Start a new task by clicking the menu Archive the assignment New to choose. Automator asks what type of task you have in mind. Choose Calendar reminder. Calendar reminders are run from the Calendar app.

Tip 01 First you select the type of task that Automator should create.

Tip 02: Retrieve web pages

In the left column you see the Library. Select there Internetbecause you want to open a web page. When you have clicked on the Internet, 21 actions appear in the next column. First you drag the action Get specified URLs to the right column. You can also just double click on this action, then the action will automatically move to the right column, which we Workflow to mention. In this action you note the web page that Automator should open. Because we want to open not one but three web pages at the same time, click the Add button and add the second and third url. With the button Delete you can delete a previously entered url. You can put together an automated workflow by dragging actions together. You have already specified which web addresses the browser should retrieve. Now you drag the action Display web pages in the Workflow.

Tip 02 Enter the internet addresses that your browser will open in separate tabs.

Standard web browser

You can decide which web browser the system will open by default.
When the script is ready, you can test the action

Tip 03: Calendar reminder

Basically the script is ready. Then it is time to test the action. Click the button at the top right Carry out. If all goes well, the three web pages will pop up in tabs of your favorite browser. If this works, go to in Automator Archive and choose you Save. Since you specified in the beginning that the Automator action is a Calendar reminder, you will find the saved reminder in the Calendar app. These types of actions are listed in the left column of your Calendar. Just like any other agenda item, you can indicate at what time this item will take place (in our case at 9:00 am). In addition, you indicate in the Agenda that this item must repeat itself every day.

Tip 03 In the Agenda you can arrange at what time and how often this action should be done.

Tip 04: Open tabs in one click

You can also create an Automator application that opens a set of browser tabs with one click. You create a new document in Automator again, but then you select Application as type and you open the category Internet. Then you drag the action Get specified URLs to the workflow and add the desired internet addresses. Drag the action Display web pages under the previous action and test the script. Then you save the Automator promotion somewhere on your hard drive, for example on the desktop. Or you drag it into the Dock. Each time you open the action, the web pages will appear in different tabs.

Tip 04 You can save the application somewhere in a folder or on the desktop.
This Automator promotion remains the fastest way to get all images from a web page

Tip 05: Download pictures

With a so-called Task sequence you can have an action performed in the Automator app. That means you have to open Automator to start the action, which is not the case in the two previous examples. And yet this Automator promotion is the fastest way to bring in all the images from a web page. From New do you choose one Task sequence. Then choose the Internet category in the left column. This time you drag the action Get current web page from Safari on the workflow. Unfortunately, this workflow really only works with Safari.

Tip 05 This action only works if the page you want to download from is already open.

Tip 06: Go to Downloads folder

You then have to drag two more actions into the workflow. First you add the action: Get URLs of images from web page. Then you do the same with the promotion Download URLs. In this action you indicate in which folder the images should be placed. To test the workflow, open a web page in Safari with many images and then click the button in Automator Carry out. If you have all the images in the folder Downloads you know the script has done its job. Save this Task Sequence somewhere on your hard drive.

Tip 06 The images all end up in the Downloads folder.

Tip 07: Get articles

If you are interested in RSS feeds, you can use Automator to find feeds that follow your favorite topics. First create a new one Task sequence in Automator. From the category Internet you drag the action Get specified URLs to the workflow. In the box Address from this action, type the url of the feed you want to search. After that you have to set the filter on this feed. So you drag the action Filter articles to the workflow and then you specify the filter criteria. For example, do you want the title to contain a specific search term? Or do you want to search for a specific term in the content of the article? You can also search based on the publication period or in the summary. Then you add the action Get link URLs from articles. The last action you add is Display web pages. This way you know that the results will be shown in separate tabs again. That is also the reason why you must handle the filter with care. If it produces too many results, you will also be presented with an awful lot of tabs.

Tip 07 During the test you can read how long each part has taken up.
With a slightly more complex workflow, you can download any audio or video files from a web page

Tip 08: Finding media

With a slightly more complicated workflow, it is possible to download all audio or video files from a given web page. Create a new one Task sequence in Automator and from the Internet category you place the action Get current webpage from Safari. Immediately after that, you place Get URLs of links on web pages. In this action you will see the option Only display URLs in the same domain as the home page. When you use that option, you will only download the audio or video files that are hosted on the same domain as the current web page. If you don’t select this option, you will go for all media files associated with this page, regardless of where they actually reside.

Tip 08 Here we fetch the media hosted on the same domain as the web page.

Tip 09: Filter urls

Then you place a third action: Filter URLs. Here you have to decide which file formats you want to download. For example, if you only want to download MP3 files, you set the criterion to the path contains .mp3. If you also want to download mp4 video files, add the path contains .mp4 and so on. Now that the urls have been filtered, one more action is needed, namely Download URLs. Here you choose a download folder. Next you have to remember to run the workflow from Automator and this script will download the media from all open webpages in Safari.

Tip 09 Which file formats do you want to download?

Tip 10: Delete downloads

The folder where your browser places the downloads quickly becomes a repository. In Windows 10, you can make files that have been in the Downloads folder for a specified period of time automatically disappear. In macOS you can do the same with an Automator script. For that you go to New and select the type Folder action. Then you drag from the category Files and Folders the action Find Finder Parts to the workflow. In this action you select in the box Search in the location Downloads. Then you determine the search criteria. For example, you indicate that everything may be deleted that you have not opened in the past month. The criterion that you then set with the check boxes looks like this: search in Downloads, all parts of which the Opening date corresponds to Has not been in the past: 30 days.

Tip 10 First collect the files in the Downloads folder that you have not used for thirty days.

Tip 11: Finder preferences

Then you drag a second action into the workflow that comes from the same category, the action Move Finder assets to the trash. There is no action to automatically empty the Trash, but you don’t have to as this option is standard in the Finder. Open the Finder by clicking the smiling face icon in the Dock. In the menu bar click on Finder and then on Preferences. In the window Finder Preferences go to the tab Advanced. And finally you put a check mark Remove parts from trash after 30 days.

Tip 11 To empty the trash, use the Finder preferences.
.

Recent Articles

Related Stories