Five Automator procedures for those who value their time. Automator - application tips Downloading all images on a page

Automator appeared for the first time in the Mac OS X Tiger (10.4) operating system. This program was developed to automate most of all operations performed on a computer. At the same time, creating automatic actions using Automator does not require any special programming skills. This is due to the following: the development of automated processes is carried out in a graphical interface, so the user’s task is to determine the sequence of actions, moving them from one panel to another.

More advanced users with some programming knowledge have the opportunity to create unique scripts, since Automator supports the Apple Script feature.

This program can handle many tasks

What processes can Automator handle?

As noted above, the essence of this program is that the user selects the order in which specific operations are performed. Moreover, the values ​​returned by the previous process are the input values ​​for the subsequent action.

Automator makes it possible to automate both simple and complex tasks, from the Finder and Address Book programs to Adobe Photoshop, for example:

  • creating and printing a family directory containing contacts;
  • translation of any texts;
  • backup of certain information by simply dragging it into the desired folder;
  • grouping files according to established characteristics, etc.

Automator's capabilities are simply amazing - this program only takes a couple of seconds to perform a particular operation, while manually it can take hours.

Examples of working with Automator

Beginner users will certainly find it interesting and useful to learn how to work with the Automator program, discussed with specific examples.

The easiest way to understand the basic provisions of this program is to automatically launch an application. Before you start creating your first action, you should launch Automator itself. A menu will appear on the monitor in which you need to select the initial project. As a rule, many users choose the “Arbitrary” project. This allows you to get a process that you can fill from beginning to end with your own operations.

Main program window

The next step towards creating a simple automation process is to go to the “Actions” tab to the “Utilities” field. Of all the possible actions, you must select “Run a program” and drag it to the field where the processes are located in the order in which they are executed.

Further operations are also extremely simple: select the program to launch and save the entire process (via the File/Save As menu).

In principle, all processes are created with such ease in Automator. However, this example had no real benefit, but was used only as training. But now we can move on to consider more clear examples.

A fairly useful action is to automatically close all programs open at a particular moment. Why is this necessary:

  1. This function is in demand in situations where the user urgently needs to turn off the computer without fear of losing data, because, as you know, this requires correctly closing all used applications.
  2. This method makes it easier to close programs if the user is working with a large number of applications at the same time. For example, image processing is performed using an editor and additional utilities. Of course, in this situation it is much easier and more convenient to automate the closing process than to carry it out manually.

Creating such a function in Automator is similar to the previous process discussed. The slight difference is that from the list of actions offered in the “Utilities” field, instead of “Run a program,” you should select “End all programs.” This will close all programs (with the exception of system processes such as Finder). In addition, in order for the script to close a specific application, it must be added to a special list.

The working process

If desired, you can make sure that the system user is notified about closing programs via a voice message. To do this, you will need to go to the “Text” field, which contains actions such as: “Get the specified text”, “Say”. They should be transferred to the program being created in exactly the same order.

The “Get specified text” field must be filled in with the words that will inform you that all programs are closed. In the “Speak” action, there are several system voices to choose from, from which you should choose one: it will notify you about the completion of the process.

Once compilation is complete, the created application will be able to perform all the tasks assigned to it. This example clearly shows how to create complex activities that consist of multiple processes that involve passing data from one activity to another.

Summarizing

At the moment, Automator has a huge number of possibilities, even a whole book would not be enough to describe them. Its main feature is its simplicity, that is, a user of any qualification can easily work with this program. Beginners will be able to intuitively create the desired actions and it will not cause them any difficulties. More experienced and advanced users, in turn, will be able to appreciate the extensive capabilities of Automator.

One of the best optimizers

It is worth noting that in situations where the process of creating the desired action is not in the standard set of operations or even on the official Apple website, the event recording function will help. To do this, you need to select the appropriate menu item for this program and start performing certain actions in Mac OS X. After you move the recorded actions into the created process, all of them will be reproduced exactly. This will allow you to create more and more new functions very easily and simply.

A robot programmed to follow your instructions - who would refuse that? Unfortunately, many users think about Automator Mac's newest automation tool is like a toy for beginners who are too scared to learn AppleScript. In fact, Automator can be very powerful - especially when combined with other OS X features such as Unix commands, built-in image processing, and even AppleScript.

Here are five useful/fun (underline as appropriate) Automator procedures that will make you the envy of all computer geeks in the city 😉

You can do all 5 procedures that will be discussed.

First, launch Automator (in your Applications folder) to get started. Now decide on an application that can perform the action you need and click on this application in the “Library” column, then in the adjacent “Actions” column, select the appropriate action and drag it to the script construction area (Workflow). (The applications and corresponding actions that we will use are highlighted in bold below in the text.)

If you want to save the Workflow, select File > Save. If you want to save the procedure as an application (so it can be launched by double-clicking), select "Application" from the File Format drop-down menu in the save dialog.

So, let's start practicing.

Back up Word documents

Everyone knows that backing up important files is a good idea, but many people forget to do it. This procedure makes backup easy; when you run it, all recently modified Microsoft Word files in your Documents folder are archived and then burned to CD. Run this process every week and you'll never lose more than the last few days of Word work.

1. Finder: Find Finder Items This action searches for all files on your hard drive that meet a specified criteria. First, click on the Where drop-down menu and select Documents, so the procedure will only search in your Documents folder. Next, from the Whose drop-down menus, select Date Modified on the left, and select This Week on the right. Click the plus sign (+) to add another criterion. In the new pop-up menu line that appears, select Extension in the first menu. In the next one, put the value Is Equal To (equivalent) and then the document type doc in the text field next to this menu. This procedure will now look for files in your Documents folder that were changed this week and are Microsoft Word files.

2. Finder: Create Archive When you run your procedure, this action takes all the files found in the first step and compresses them into a single ZIP file. In the Save As field, specify a name, for example: Word files backup.

3. System: Burn A Disc This action puts the compressed file from step 2 on its own blank CD (or DVD). Specify a name in the Disc Name field, for example “Word Backup CD”, and check the “Append Date” checkbox, so the CD name will contain the recording date, which will make it easier to find later.

4. Finder: Move To Trash This action moves the ZIP file created in step 2 to Trash.

Other ideas: If you want to duplicate something other than Word files with this procedure, simply change the criterion in the first step; you can set any type you want (HTML, for example).

To make the process even more convenient, use the alarm function in iCal to schedule it to start automatically. To do this, save the procedure as an attachment, as described at the beginning of this article. In iCal, select File: New Event, select View: Show Info, click the Alarm drop-down menu, and select Open File. In the dialog box that appears, select your procedure.

Getting information about your Mac

Do all the Macs in your class have the latest version of OS X? Do you find that you often find yourself desperately searching for information about your computer's RAM when talking to Apple tech support? Even though OS X includes a System Profiler utility for getting information about your Mac, it's still difficult to keep track of all the statistics at once. This procedure extracts all the profile information from your Mac and returns it as a text file.

1. System: System Profile Click on Options and turn on Show Action When Run. When you run the procedure, it will ask you about what part of the computer you would like information about - software, printers, AirPorts, etc.

2. TextEdit: Filter Paragraphs In step 1, we get one large piece of text containing the profile information filtered by your query - but this text contains a lot of empty lines. To remove them, set the Return Paragraphs parameter in the drop-down menu for this action to Are Not Empty.

3. TextEdit: New Text File This action saves the text received after step 2 into its own file. Enter, for example, “Profile.txt” in the Save As field, and then select your Documents folder in the Where pop-up menu - the profile will be saved here.

4. Finder: Open Finder Items This action opens the file for viewing. Leave the Open With drop-down menu set to Default Application to open the file using TextEdit, or, depending on your needs, choose another application that can read plain text, such as Microsoft Word or Apple Safari.

Other ideas: If you need to call Apple technical support, print out your profile generated by this procedure so you can contact it. If you run a computer lab, use text reports generated on each machine to create system statistics.

Make man pages more digestible

When learning Unix commands, such as grep or uptime, experts first turn to manuals for help using the man command. This procedure will save you from opening the Terminal and straining your eyes to read this text in an inconvenient format. Instead, you can open any manual page in TextEdit and print or save for easier reading.

1. TextEdit: Ask For Text When you run a procedure, this action will help you identify the correct man page. In the Question field, enter something like “What Unix command would you like to learn about today?”, i.e. What Unix command would you like to learn today? And select the Require An Answer option.

2. Automator: Run Shell Script Use this action to run Unix commands that locate and generate the man page for TextEdit. Select As Arguments from the Pass Input drop-down menu. Then enter the command man “$@” | col -b in the large text field (see first screenshot, A).

3. TextEdit: New TextEdit Document This action opens the newly generated manual page in TextEdit.

Other ideas: Save a frequently used man page (for programming languages ​​like Perl or Ruby, say) as a text file, and keep it in your documents for quick access.

Surveillance camera installation

If you have a digital camera, then there is some chance that your Mac can make it take pictures while connected to your computer. (The camera must be able to take photos when it is connected to USB. The first step in this procedure will tell you if it can do this.) This routine will tell the camera to take a photo every 10 seconds, compress it into a small JPEG, and repeat until you stop the program. This can be useful in many situations - when you're trying to figure out what your dog is doing when you're not home, for example, or if you want to make a slow-motion video without buying additional software.

1. Image Capture: Take Picture This action tells the camera to take a photo. If your camera has limited memory, select the Delete Image From Camera After Download option. If your camera has a large memory card, naturally you don’t have to enable this option, so your photos will be on both the camera and your Mac.

Note that this action automatically saves the pictures in the Pictures folder. If you want to save the photos in a different location, add a Finder: Move Finder Items action to the procedure and define where you would like to save them here.

2. Preview: Change Type Of Images This action gives you the opportunity to convert photos to more cost-effective formats, this is especially useful if your camera shoots in TIFF or Raw format. When you paste this action into your procedure, a dialog box will appear asking if you want to add an action that will copy your snapshots before changing them. Click on Don’t Add, this will prevent you from making 2 copies of each photo. Then, to save more space, select JPEG 2000 from the To Type drop-down menu if your graphics editor supports this format - Apple Preview, Adobe Photoshop and Photoshop Elements do. (If you use Photoshop, you may need some plugins from the installation disk). Otherwise, just select JPEG.

3. Preview: Scale Images This action compresses the size of each photo to further save space. You will see the same dialog box when you insert this action into your procedure. Click on Don’t Add again. Unless you need these photos in high resolution, although the standard size of 480 pixels is usually sufficient.

4. Automator: Pause Add this action to force Automator to pause before taking the next photo. Enter 10 in the text field to force the procedure to pause for 10 seconds. Before you move on to the next step, save the procedure (as Workflow) and give it a name.

5. Automator: Run Workflow To force the procedure to take the next image, you need to force it to repeat the steps. This action restarts it again. From the Workflow pop-up menu, select Other, and then select the procedure you saved in step 4. Now save the procedure under the same name again.

To test your new program, run the script with the Run button. When you have finished taking images, you can interrupt the execution of the script by clicking on the Stop button.

Other ideas: When you've stopped the process, drag images into iMovie to make a time-lapse video. You can also use the same Automator to force QuickTime Pro to make a slideshow - a 2-step task!

First, let's look at working with Automator. It's a far cry from "real" programming, but no less exciting and rewarding.

After that, let's move on to scripting languages; their work is not much different from work in other operating systems.

When all this is mastered, let’s cast aside all doubts and rush into the very depths. Into programming directly for Mac OS X. Native apps, native development language, native IDE, native problems.

Automator

Automator is a standard program that comes with the operating system and allows you to automate simple actions. In fact, you can use it to create different actions without calling them programs. This is cool. The developers are scared and don’t want to get involved with it. But this doesn’t seem to be programming, so you can try.

Rice. 2 - Automator started

Let's start the automaton. Immediately after launch, a window will appear with the ability to select the type "workflow"(“work process” in Russian translation) (Fig. 2). What it is? This literally translates as “work flow.” It's actually a sequence of actions. For example, what do you need to do to make coffee?

  1. Take coffee from the can in the closet.
  2. Find a coffee grinder.
  3. Grind coffee.
  4. Place ground coffee into the coffee maker.
  5. Pour water into the coffee maker.
  6. Put down the cup.
  7. Turn on the coffee maker and wait until it turns off.
  8. Take a cup and put it on the table.

It is precisely this sequence of actions that is called the incomprehensible word “workflow” or the no less incomprehensible “work process”. When working with an automator, we type actions one after another in order to obtain a result from the initial data.

The type of workflow (let's take this term as a starting point, since it was translated this way to Apple) determines exactly the initial data with which you want to do something. We are offered to work with files, audio data, photographs, text, or something completely incomprehensible and our own. For example, let's try to take an Internet page, download all the pictures from it, making fun of them a little along the way. And save the result to your folder.

This is where a little leapfrog begins. In the English version, you can select the appropriate type of process that collects links to pictures from the current page. This is not the case in the Russian version. Therefore, in order to avoid unnecessary repetitions and disagreements, we select the “Free” or “Custom” process type. A blank field appears on the right, where we will create a sequence of actions and an impressive list of actions on the left. Let's make a preliminary list of what needs to be done:

  1. Take the current Safari application page.
  2. Get all the pictures from there.
  3. Make fun of them (they should all be the same).
  4. Save the result.

Safari seems to be related to the Internet. Therefore, we select the section "Internet", there is an action “Get current page from Safari", drag it into the field on the right (Fig. 3).

Fig. 3 - Drag the first action

You need to pick out pictures from the resulting page. There is no required action. But there is an action that gets URLs pictures, that is, their addresses. Well, let's try. Drag the “Get URL of web page images” action so that it appears below the previous one. This is a general rule and the process is done from top to bottom. Please note that the actions are linked by an arrow. This means that the result of the top action is used in the bottom one. If not used, there will be no arrow. But what to do with these addresses? Download! Since the term “download” is informal, we are looking for something more formal. ABOUT! "Load URL". Let's take it. We drag this action, the arrow appears again. There is some kind of incomprehensible field in the action (Fig. 4).

The field is called “Where” (although it should be called “Where”) and shows where to save the mined items. Let's leave it as it is. If we click on “Description”, we will see that the action receives as input URL addresses, as a result “Files/folders”. This is good because we are now working with files. We were able to convert the links on the page into real pictures on our computer. Let's move on.

Select the “Photo” library in the list of actions on the left. We are now interested in some kind of perversion. Suitable: “Image Processing” Quartz- filter." Sounds mysterious. It's really just applying filters to pictures. Like Sepia. Drag the action under the others, select the filter type to your liking. During the dragging process, we will be warned that this filter is committing abuse on images. This suits us, so we boldly agree.

All that remains is to take the received files and put them in some correct place. Let this correct place be in “Documents”, in the subfolder “Pictures from the Internet”. We work with files, so we select the “Files and Folders” action library; there is a wonderful “New Folder” action there. It’s great because, having selected it and looked at the description (at the bottom of the list of actions), we read: “This action creates a new folder with the specified name. Input:(Files/Folders) If files are submitted to this activity, they will be copied to a new folder. Result: Files/folders." Great! Exactly what we need. Let's throw it down. Enter the name of the new folder and choose where to create it.

Let's go check how this whole thing works. Open your favorite website in Safari. Go to Automator, and click the big “Run” button at the top right. The magic begins. Wheels spin around actions, jackdaws appear next to completed ones, and at the end a victorious “Dong” sounds. Let's check. Open in Finder folder “Pictures from the Internet”, which was created in “Documents”. Hmm, really pictures. Works!

Fig. 6 - What does the “workflow” look like after execution

Pay attention to the green “daws” at the bottom left of each action. This indicates that the action was completed successfully. If something breaks, there will be a red X.

The first steps have been taken. Here is a list of what else you can do using Automator:

  1. Rename a bunch of files.
  2. Send file(s) directly from your desktop by email.
  3. Bulk resize images. Both files and album in iPhoto.
  4. Make a mailing to your address book (to a group of addresses).
  5. Make an audio file from a text file (unfortunately, there is no way to make the computer speak Russian).
  6. Upload the resulting file to FTP.

All these and other actions can be combined in any order. In general, there is huge scope for creativity. And no programming. It just works!

Oddly enough, Automator has been one of the significant advantages of Mac OS X for many years now, compared even to the latest version of Windows. In addition to the fact that it can process a wide variety of data quite flexibly, “Automator” is also easy to use - the rules for processing information are compiled like cubes. However, the simplicity of this program is still far from the mythical “Do as I want” button. Therefore, some points that may be unclear to beginners are still worth clarifying.

By task and process

Depending on the situation in which you want to automatically perform specific actions, you should choose the most appropriate process type.

In the third version, Automator has significantly increased the number of types of data processing rules (or processes) - there are now seven of them. Which of these types to choose depends on the conditions under which you want to run your future algorithm. The first type, Process(Workflow) is a standard type of algorithm that can be launched either from Automator itself or saved as an application.

However, Application(Application) is the second type of Automator process that you can create from the very beginning. The name itself says that as a result you will receive a small utility (or droplet) that accepts data and processes it in strict accordance with the algorithm you created - without launching Automator. You can place the app in the Dock, Toolbar, or Finder sidebar. After this, you just need to select the required files and drag them onto the application icon - it will start, do its job and close. This way, without launching Automator itself, you can, for example, scale a stack of photos or fill in the tags of selected audio files.

Features of type processes Service(Service) is that they can be built into the context menu of programs specified in advance. Remember in the online dictionary Lingvo - the “Automator” service was used there. Of course, in addition to textual information, the service can be “fed” graphics, sound, video, PDF files - it all depends on what application you are creating the service for and what task it must perform.


The input can be not only files from a folder opened in Finder, but also from the directory of one of Apple's multimedia programs - this data is accessible through the media browser built into Automator.

Folder Actions(Folder Actions) themselves have existed for a very long time, and Automator only makes it easier to create them without the need for knowledge of the AppleScript programming language. This type of process is triggered when any files are placed in the specified folder. The most obvious example of using folder actions is to automatically sort data into nested subdirectories. There are third-party applications for this - however, you can create an analogue of them yourself in Automator.

Print plugin(Print Plugin) is built into the PDF menu in the print dialog. Using processes of this type, you can control the creation of a PDF file from the current document in Text Edit, Pages, Microsoft Word, etc. For example, when creating a PDF, you can watermark each page or convert the pages of the generated PDF -document into raster images.

iCal Reminder(iCal Alarm) are processes that run at a specified time. Let's say, on the birthday of your beloved grandmother, such an event can automatically create a letter according to the specified template - all you have to do is select the design and click the send button. You can even organize a group mailing, thereby inviting guests to the same birthday or wedding.

Finally, Image capture plugin(Image Capture Plugin) - this process is built into the module for importing photos from your camera. When copying files from the camera to an iPhoto or Aperture photo library (or simply to a folder), such a process will start itself and perform certain actions - add all the pictures to a specific album, add a text annotation to each of them, etc.

Macros at random


By clicking on the record button, manually execute all the necessary commands using the mouse and keyboard. When finished, stop recording and view the list of commands recorded by Automator.

If you are familiar with Microsoft Office applications, you know that they have (in the Mac version there was) an action recording mode. This is when you simply select the necessary buttons and menu commands, enter some text, add some objects - and the program consistently records all your actions. The third version of Automator is equipped with a similar mode that remembers not only your actions, but also the programs in which they were performed. The playback speed of recorded actions can be adjusted from one tenth to ten times. The recording mode is activated by the corresponding button on the Automator toolbar.

Display Mode

Notice the sidebar of the Automator window. By default, the action catalog (Library) is structured by categories - actions are grouped depending on what types of data they work with. But instead of categories, you can display a list of applications to which actions are associated. To do this, select the command in the “Automator” menu ViewSort actions byprogram (ViewArrange Actions byApplication).

Who's ready?

The creation of many processes can be simplified even further by downloading them from one of the specialized sites dedicated to the Automator program. Bookmark these resources:
automatoractions.com ,
,
,
,
.
In addition, sets of actions are being developed for professional programs - products from Adobe, Quark and others - for which you already have to pay, sometimes impressive sums.

Examples and reference

For those who are completely unfamiliar with Automator, but want to master this program, it is worth paying attention to simple examples that, although not always interesting from a practical point of view, form an idea of ​​​​the possibilities of automating tasks on a Mac. Take note of these resources and web pages: homepage.mac.com/cjrtools/automator-apps/index.html,
,
.

If the topic of automation is interesting to ProstoMAK readers, step-by-step instructions for creating useful processes will appear regularly in this blog. Let me know in the comments what you think about it.

Automator creates workflows, which are chains of standard operations based on typical operations performed by most applications. These generic workflows allow you to automate tedious, repetitive, and routine tasks that you often need to perform on your computer. With Automator, you don't even need to know any programming language to create generic workflow actions. For those who are not good at writing shell scripts, or even just afraid of the Terminal command line, Automator is the best way to create programs to automate common routine tasks. All you have to do is map out the operations you want to perform and see if Automator has common events and actions that you can use to perform those operations.

For example, imagine you need to rename, resize, and then email a set of photos. This entire sequence of operations can be programmed as an Automator chain of actions, which can then be executed automatically. Let's take another example - let's say you want a specific folder to be backed up every time you put something new into it. Automator can help you here too. Or, let's say, if you just want to close all your running apps from the Dock, Automator already has a procedure for doing just that. All of the examples above look at basic tasks, but you can create more complex procedures - either by writing programs in AppleScript or using advanced and additional Automator events and actions.

In this article, I will show some simple example procedures that will clearly demonstrate the development of solutions using Automator. In addition, I recommend that you visit several Web sites dedicated to Automator programming. These sites provide additional information on the development of document flow procedures, and ready-made solutions are also available for download. Here are just some of the most informative Web sites dedicated to Automator:

  • Apple Mac 101: Automator Tutorial (http://docs.info.apple.com/article.html?artnum=304759).
  • Automator World (http://automatorworld.com) is a site that provides a large number of ready-to-use document workflows, as well as useful tips, recipes and news about the Automator application.
  • Ready-made solutions (actions and document flow procedures) are available for free download on the Apple website: http://www.apple.com/downloads/macosx/automator.

Automator procedure for closing all applications

Let's begin our introduction to Automator 2.0, which comes with Mac OS X Leopard, by creating a simple automated procedure that will close all running applications except Finder. If you do not want to see a list of Automator procedure starting points every time you launch this application, click the Automator option on the left side of the menu bar and select Disable Starting Points.

The Automator application, represented by the Otto icon, is located in your Applications folder (Otto is the name of the robot). When you open the application, you will see a list of starting points from which you should begin developing document flow diagrams (Fig. 3.27). Select the Custom option and click the Choose button.

If you have previously used (or are still using) the first version of Automator (part of Tiger), then it may have caused (or continues to cause) you some complaints. It's true that you can create great automated routines with this early version, but if something goes wrong, the routine simply doesn't work, and it's very difficult for the user to figure out why it's failing. This flaw has been fixed in Automator 2.0 and later. You are now able to examine each step of the automated procedure and see what results it returns. This feature is very important for those who really want to use Automator to automate routine and frequently repetitive tasks.


At this stage, you will see a window consisting of five parts. In the left column, you'll see a list of apps, Finder features, and utilities that include actions and the events that are set for them. In the same column you will also find intelligent groups of folders, with the help of which you can organize all your actions (elementary operations) and automated procedures. The middle column lists all available actions and events that can be found by searching or clicking on one of the items listed in the first column. The area below the first two columns provides a brief description of the selected actions. The box below this area provides copyright information for each action. The larger panel, located to the right, is designed to create a chain of actions that form an automated procedure.

Assembling a procedure is done by dragging actions and events from the middle column. Drag and drop is done using the standard drag and drop technique. The simplest automated procedures consist of a single action or event, while more complex procedures require additional input. Actions and events must be ordered. For example, some actions require the identification of one or more files in which information will be passed on to subsequent actions and events.


At the top of the window there is a toolbar with five buttons. The leftmost button, Hide Library, allows you to hide the first two columns. The Media button gives you access to all audio files stored in your iTunes library or created with GarageBand, your photos created with iPhoto and Aperture, and videos created with iMovie '08, iPhoto, iTunes and stored in your Movies folder. All these multimedia files can be used to create automated procedures.

The Record button allows you to record sequences of actions. This is a new feature introduced in Automator 2.0. It will be discussed in more detail a little further. The Run button is used to run an automated procedure, allowing you to test it and see how it works in practice. Of course, there is also a Stop button, with which you can interrupt the running automated procedure.

In the Library panel, which contains the first two columns, click the Actions button and select the Utilities option. Go to the next column, scroll down and find the Quit All Applications action. Drag this action to the right panel designed to assemble an automated procedure. As a result, the Automator application window will look like shown in Fig. 3.28. At this point, you can optionally test the automated procedure by clicking the Run button on the toolbar. As expected, this procedure will close all running applications, including Automator.


If you want the system to prompt you to save changes before closing the application, leave the Ask to Save Changes checkbox selected. If you want some applications to remain running and not be closed (if they are running), you can add them to the Do not quit list by clicking the Add button. At the bottom of the window describing the action are three additional options. When performing an automated procedure or action, click the Results button if you want to check whether the action was completed successfully. In case of failure, you will receive an explanation of the reasons.

Clicking the Options button allows you to specify choices that you can make before or during the execution of an automated procedure or action. In this particular example, if you select the Show this action when the workflow runs option, you will be able to cancel the action before it is executed, and add or remove the applications listed in the automated procedure (Figure 3.29). The Descriptions button provides additional information about how this automated procedure will work and what results you plan to obtain from it. In addition, it gives some guidance on the actions and events included in it.

Once your automated procedure has been written and tested, you will need a method to run it without having to launch the Automator application itself. To achieve this goal, save the automated procedure as an application. For this purpose, select the File → Save command from the menu. Select the folder where you want to save your new automated procedure. You may want to save it in your personal Applications folder or in a separate folder that you can create specifically to store all of your automated routines. Then from the File Format list, select the Application option (Fig. 3.30). Of course, you can save a procedure as a set of actions (to do this, select the Workflow option), but in this case, when you click on your procedure, it will expand in Automator. If the automated procedure is saved in application format, it will behave exactly like any other application installed on your computer.

You can create a similar automated process to selectively close applications, so that only the applications on the list are closed. To do this, drag the Quit Application action (located in the list directly after the Quit All Applications action) for each application that you want to close automatically, and save the entire automated procedure as an application.

After you save an automated procedure as an application, you can locate it where you saved it and drag that application's icon into the Dock, placing it next to the Finder icon. This way you will be able to very quickly (in fact, with a single mouse click) close all running applications, without having to do this procedure individually for each of the running applications.


Access to view media files

If you are an experienced user of iLife programs such as iMovie and iDVD, or iWork programs such as Keynote or Pages, then you probably know that each of these applications has a special browser for viewing media files designed to select and use images from your iPhoto library (or Aperture 1.5, if you have installed that software).

However, imagine a situation where you need to access your iPhoto or Aperture photos while working with applications that don't have media browser functionality. In this case, the Automator application will again come to your aid. Using Automator, you can create a browser for photos or audio files that you can access from anywhere (for example, from the Finder).

To do this you will need to do the following:

  1. Launch Automator 2.0 and select the Custom option.
  2. In the leftmost column of the Automator browser, select the Photos option. Then go to the second column and select the Ask for photos option. If you'd like to create a similar browser for music files stored in your iTunes and GarageBand libraries, click the Music Actions option in the Automator library, and then select the Ask for Songs option in the middle column.
  3. Drag the Ask for photos action into the main automated procedure editing window.
  4. In the Prompt field, enter a descriptive text string, such as Get My Photos.
  5. Now select File → Save As from the command menu and save the automated procedure as an application. It's convenient to save your new application in the Applications folder, from where you can drag it onto the Dock for quick access to the application. Additionally, you can save an automated procedure as a plug-in file (File → Save As Plug-in), which can be accessed in several different ways on Mac OS X. For example, if you saved the procedure as a Finder plugin, you can access the plugin by Ctrl-clicking or by selecting More → Automator → Get My Photos from the context menu. You can save the plugin as a script, after which it will be saved and accessible through the Scripts menu, which you can add to the menu bar (run /Applications/AppleScript/AppleScript Utility and select Show Script Menu in menu bar).
  6. Now you just need to click on the new application icon in the Dock, and the iPhoto or Aperture photo browser will appear on the screen (provided that one or both of these applications are installed on your computer - Fig. 3.31). Now you can drag and drop the desired photos into your application, where you can manipulate the high-resolution image as you please.

Watch Me Do function

The more actively you use Automator and explore its capabilities, the more conveniently you will be able to organize and automate your work. In addition, if you thoroughly study Apple's classic automation program, AppleScript, you will learn how to create even more complex and advanced automated procedures. However, if you can't or don't want to learn a programming language, you can use Automator to record keyboard and mouse sequences so you can create new actions outside of Automator's built-in standard actions.

To do this, you should use the Watch Me Do function, which is designed specifically for recording user operations and creating new automated procedures based on them. To use this feature, open the Universal Access preference settings panel (System Preferences → Universal Access) and enable accessory access. Keep in mind that activity recording does not work in all cases, but when available, this feature is quite useful.

Before testing this feature, create a WatchMe folder on your desktop and place a few unimportant files that you don't value in it. Then drag the folder into the Dock, where it will always be easily accessible. Next, perform the following operations:

  1. Launch Automator and select the Custom option.
  2. Click the red Record button on the Automator toolbar. As a result, the Automator interface will change - instead of the Automator window, a small black square will appear on the screen, indicating that all keyboard and mouse events will be recorded until you click the Stop button.
  3. In this example, let's perform the following operations. While Automator is in recording mode, hover over the WatchMe folder in the Dock and Command-click it. When the folder opens on your desktop, press Command+A. Then click the Delete button on the toolbar. All files located in the WatchMe folder will be deleted to the Trash. Do not empty the Trash, but instead click the Stop button in the recorder window. You can return all files back to the WatchMe folder by pressing the keyboard shortcut Command+Z.
  4. Now is the time to look at the automated Watch Me Do procedure, which reflects the result of recording all the actions performed in the previous step (Fig. 3.32). Click the Run button on the Automator toolbar. You will see how Automator will exactly reproduce all the cursor movements and keyboard shortcuts you performed in the previous step. Once the automated procedure is complete, press Command+Z in the Finder window if you want to cancel deleting the files.
  5. If you wish, you can perform the operation again, but this time change the playback speed by moving the Playback Speed ​​slider on the right side of the window to 10x so that the operation completes faster than the default.

Placement of automated procedures

Once you've created and saved your automated routines, you can expand your Home folder and navigate to the Library/Workflow/Application folder. Within it, you'll see folders for all the automated routines you've saved for your Finder, Folder, or iCal automated routines.

In addition, you can save your automated procedures for future development or modification. To do this, open the procedure you are interested in in Automator, select the File → Save or Save As command from the menu and save the automated procedure in Workflow format. You can save an automated procedure anywhere - when you open it, Automator will launch automatically, and you can continue the development process until you are completely satisfied with the result.

There's obviously a lot more to Automator than what's described in this section, but this recipe is intended to give you the bare minimum of knowledge and a basic idea of ​​where to start. Where you want to go and how much you want to simplify your life with automation is up to you. On a personal note, I would like to note that the time spent on learning the capabilities of Automator will pay off very quickly, and in the future you will be able to achieve significant savings in time and effort.

 

It might be useful to read: