MacAutomation

Latest

  • Snow Leopard offers more Automator "purrfection"

    by 
    Cory Bohon
    Cory Bohon
    06.11.2009

    If you know me, then you know that I love Automator and scripting things on the Mac. I believe that Automator should be something that everyone can take advantage of, not just the select few that already know how to use it well. That's why I've been working on the TUAW Mac Automation and AppleScript series for over a year now (we're going to have more coming soon, so stay tuned). I was watching the WWDC '09 keynote, desperately waiting to see if anything new was announced for Mac OS X 10.6 Snow Leopard in regards to automation, and specifically Automator.app. Nothing was said at the keynote, but when I looked on the newly updated Snow Leopard page on Apple's site, I was ecstatic. One of the refinements listed was that Mac OS X Services would now be a feature of Automator. Services let you use features of one application while you are inside of another. In the Automator instance, you would be able to use workflows while you are inside of any Mac OS X application that supports the use of Services. In addition to updating Automator for Services, Apple has also added more starting points for workflows. You can now choose between a standard workflow, application, service, folder action, print plugin, iCal alarm, or an image capture plugin. We will have more information about Automator and Services in Snow Leopard when it launches in September.

  • Mac Automation: Make your text speak its mind

    by 
    Cory Bohon
    Cory Bohon
    04.13.2009

    Have you ever wanted to type something into your Mac and have it record what you typed audibly using any one of the Mac OS X voices? It's easily done with a few Automator actions, and in this Mac Automation post, I'll show you how. Open Automator and find the following actions, then drag them to the workflow area (in the same order): Get Specified Text Text to Audio File Running the workflowWith these two actions in place, you can enter text into the Get Specified Text action, and a file name in the Text to Audio File action, and run it with great results. The text that you enter will be magically encoded into audio using the specified voice in the audio file action. Read on to learn more about saving the workflow, and adding additional options.

  • Mac Automation: Integrating Spotlight searches with your workflows

    by 
    Cory Bohon
    Cory Bohon
    03.30.2009

    We've discussed some pretty neat uses for Automator workflows in the past, but did you know you can easily integrate Spotlight searches into your automation workflows? Well, you can, and it might be easier than you think. In this Mac Automation post, I'm going to show you how you can integrate it into a workflow that will burn the resulting files to a CD or DVD. Creating the workflowTo create this simple workflow, you'll need to use two actions. Find the "Spotlight" action and drag it to your workflow section; then, find the "Burn a Disc" action and drag it below the newly added Spotlight action. That's it; your workflow is now completed, but we need to tweak the actions. Using the workflowTo test the workflow, you can enter a search term in the Spotlight action, and a Disc name in the Burn a Disc action. Insert a rewritable disc, or a regular CD/DVD, and click the "Run" button in the upper right corner of the Automator window. Automator will then go to work finding all of the search terms that matched files, then will then burn all found items to the disc. This could take a while to burn, depending on the resulting files. Remember that all of the Spotlight tricks, such as exclusion, denoting kind, etc. are still available even though you're using the Automator action.

  • AppleScript: Exploring the power of Folder Actions, part II

    by 
    Cory Bohon
    Cory Bohon
    02.23.2009

    In the last AppleScript post, I mentioned some of the useful ways to create Folder Actions, and showed you how to use one of the built-in scripts to perform a pretty useful action. In this AppleScript post, we'll dive into the built-in scripts in more detail, and I will tell you how each of them works. Once you create a new folder action (as we did in the last tutorial), you will have a pop-up dialog asking if you would like to attach an Apple-created script. There should be around 13 preinstalled on your Mac. Now let's go through each of them, and see what they will do when attached: Add-new item alert.scpt - This included script, which we covered in the last post, allows you to get a pop-up dialog upon dropping files in the attached folder. So, if you were to drop file x into the folder, a dialog would display a message that file x was just dropped in there. This script is great for networked folders, as you get a dialog when someone drops something in there. Close-close sub-folders.scpt - This script will, when a file is dropped in the attached folder, close all opened Finder windows associated with that folder and subfolders. So, if you have that folder opened, or another subfolder within that folder, when you drop a file into it the script will close those opened Finder windows. You can use this script to tidy up your screen. Convert-PostScript to PDF.scpt - If you have a PostScript file type (i.e. eps or ps files), then you can enable this folder action. When you drop a PostScript file on it there will be two folders created, one called "Original" and the other called "PDF." This folder action will take those PS files and turn them into PDFs for your instant viewing pleasure. You can use it in your workflow to easily convert from PS to PDF. Read on to learn about even more built-in folder action scripts.

  • AppleScript: Exploring the power of Folder Actions, part I

    by 
    Cory Bohon
    Cory Bohon
    02.16.2009

    Welcome to Part I of this mini AppleScript feature on creating useful folder actions. We'll have more posts on this topic coming up, but for now, let's introduce what a folder action is. Have you ever wanted to just drop a file into a folder and have something magically happen? Say, have a file printed, whisked to a remote site via FTP, or perhaps have an image be automatically flipped from horizontal to vertical? With Mac OS X's built-in folder actions, you can easily do this with a simple drag and drop. Creating the folder First, let's talk about how we can enable these "magical folders" that perform actions on files dropped within them. For this example, I'll show you how to make a folder on your desktop that, when a file gets dropped into it, will display a dialog letting your know that the file was placed there.

  • Mac Automation: Looping Workflows

    by 
    Cory Bohon
    Cory Bohon
    01.26.2009

    Sometimes when working with Automator, you might want a workflow to loop (or go back to the first step and continue to run through the workflow). Automator includes an easy-to-use "Loop" action, and in this Mac Automation post, I'm going to show you how to use it.Let's take a previous workflow that I wrote about: iCal to-dos. In this how-to, we got iCal to-dos sent to your mobile device via a simple workflow and e-mail. The method that I wrote about required you to send an email (and rely on mail rules) in order to retrieve your to-dos. However, with the looping action in Automator, you can easily automate this process. Let's first build out the workflow by placing the following actions together (in the same order): Find Calendars In iCal New Mail Message Send Outgoing Messages Pause Continue reading to learn more about the loop action.

  • Mac Automation: Creating Watch Me Do workflows

    by 
    Cory Bohon
    Cory Bohon
    01.19.2009

    Do you want to use Automator's powerful features, but don't want to worry with "programming" the usefulness each and every time you wish to perform an action? With Automator for Leopard, you have the ability to easily record mouse moves/clicks and keyboard input with a feature called "Watch Me Do." Initial SetupBefore using this Automator feature, you will need to turn on "Access for assistive devices." So head over to System Preferences > Universal Access. Make sure the checkbox is checked beside "Enable access for assistive devices." This allows Automator to control your mouse and keyboard movements/clicks/key presses. Watch Me Do will not work unless this box is checked. Recording an Action in AutomatorYou are now ready to start recording your first Watch Me Do action in Automator. This feature gives Automator additional functionality if a prebuilt action is not readily available. So, before you go creating your own Watch Me Do action, look through the action list to make sure the functionality doesn't already exist. When you are ready to record, press the "Record" button in the top-right corner of the window. The main Automator window will disappear, and you will see a heads-up display on the screen showing that Automator is recording; this display will also have a stop button -- when you are done recording your actions, you press this to return to the main Automator window. While recording, any mouse movements/clicks and key presses will be captured and added to your workflow. Managing your recorded eventsEach time you click, press a key, or move the mouse, you create an "event." Once you have recorded your Watch Me Do actions, you can reorder the specific events of the action. Just click and drag in the "Events" section. Be careful though, as some rearrangements can render the action workflow useless (i.e. reordering a click of a button before a specific dialog is displayed). In the Watch Me Do action, you can also select a Timeout in seconds, and set the playback speed. Before changing these settings, note the defaults: Timeout is set to 0 seconds, and Playback Speed is set to 1x. Read on to learn about running, saving, and get some tips about recording.

  • Mac Automation: Rename multiple files efficiently

    by 
    Cory Bohon
    Cory Bohon
    11.11.2008

    With Automator, you can easily streamline common tasks. If you work with many files (i.e. pictures), then you know how easy it is to lose track because of incorrectly named files. With this Automator workflow, you'll never lose your place (or a file) again. Building the Workflow To create this workflow, simply add the following Automator actions (in the same order): Get Specified Finder Items Rename Finder Items When you add the "Rename Finder Items" action to your workflow, Automator will ask if you want to copy the files so you don't mess with the originals. Choose "Don't Add." Configuring the Workflow In the "Rename Finder Items" action, you have almost unlimited choices for renaming schemes. To get started, select a scheme from the first drop-down box. You can choose from: Add Date or time, Add Text, Change Case, Make Sequential, Replace Text, Name Single Item. Once you select your renaming scheme, choose the options you want based on the scheme. For instance, if you wanted the "Make Sequential" scheme, you could choose to use existing naming, or create a new name. You can also select options for where to place the numbers, which number to start counting from, and how to separate the number from the rest of the text. Running the Workflow Once you have your naming scheme figured out, it's time to run the workflow, and have Automator do the heavy-lifting. Drag and drop the files you want renamed onto the "Get Specified Finder Items" workflow. They will be added to the list of files to be renamed. You can then click the "Run" button in the top-right corner of the window. Your original files will be renamed, leaving you with perfectly renamed files. You can now save your workflow. Want more Mac Automation or AppleScript tutorials? Visit TUAW's Mac Automation and AppleScript sections.

  • Mac Automation: Get to-dos sent to your mobile from iCal upon request

    by 
    Cory Bohon
    Cory Bohon
    09.30.2008

    Say you're out and about and realize that your iPhone doesn't display iCal to-dos. What do you do? You've got two options: (1) Panic, (2) Use this Automator workflow. With this workflow, you will have access to all of your to-dos, even if you are not at your computer -- you just need access to your main email account. When you send an email to your email account, this script will run, sending you back your ToDo list from iCal.Creating the Automator WorkflowTo create the Automator workflow, you need to find the following Automator actions and drag them into the workflow area of Automator (in the same order): Find iCal Items New Mail Message Send Outgoing Messages Tweaking the workflow settingsIn the "Find iCal Items" action, select "To Dos" from the "Find" drop-down menu. In the "Whose" section, select "Due Date" from the "From" box and "Today" from the second box. You can deviate from the instructions on this step and use the settings that allow you get the most use out of this workflow (for instance, you can select any interval of time you want, etc.). In the "New Mail Message" action, enter your email address in the "To" field -- this is the address that your ToDo list will be sent to. Fill in a descriptive subject line like "My ToDo Items for Today" or something similar. Be sure to select an email account that your remote Mac can utilize. Continue reading to learn how to complete this workflow and create the Mail rules.

  • Mac Automation: Quickly add to-dos/events to iCal

    by 
    Cory Bohon
    Cory Bohon
    09.29.2008

    How many times have you been watching TV and wanted to quickly add a to-do or event (maybe both) to iCal? In this Mac Automation post, I'm going to show you how to create both a to-do and an iCal event from within Automator. You will be able to add new items to iCal without ever having to open it. Let's begin. Creating the Automator Workflow (New iCal Event)First we need to create an Automator workflow that will add the to-do and event to iCal. To create the workflow, just add the "New iCal Events" action to the workflow area. Before you continue, be sure to click the "Options" button at the bottom of the action and select the "Show this action when the workflow runs" checkbox. Saving the Automator WorkflowTo give you quick and easy access to the creation of iCal events, you can choose the Save As method of your choice. Running the WorkflowTo run the workflow, click the "Run" button in the top-right corner of Automator (or launch it as an application). When you run the workflow, you will be presented with a dialog that will ask you to specify a Name, Date, Time, and other information. When you press "Continue," the workflow will create the event in iCal. Keep reading to learn how to quickly create to-dos in iCal.

  • AppleScript: Creating To-Dos in iCal

    by 
    Cory Bohon
    Cory Bohon
    08.05.2008

    Recently, a friend asked me to create an AppleScript that would allow him to automate To-Dos with a Mail.app mail rule. I immediately rose to the occasion because this was a cool idea: Mail.app could run the script when you get an ebill, for instance, for your car payment. The script would then create an iCal To-Do for "Pay your car payment, now!" The scriptset theSumm to "Pay My Bill Soon!"set dueDate to (current date) + 10 * daysset theUrl to "http://www.paymybillexample.com"set thepriority to 1tell application "iCal" make todo at end of events of (item 1 of every calendar) with properties {summary:theSumm, due date:dueDate, url:theUrl, priority:thepriority}end tell Customizing the scriptTo customize the To-Do's title, fill in the text you want, within the parenthesis on line 1. To Change the due date, change the "10" in line 2 to the number of days until it is due. If you want to change to weeks or months, use the appropriate wordage instead of "days" at the end of line 2. To change the URL, paste a URL in the parenthesis on line 3. By default, the script will set the newly created To-Do to have a priority of 1, however, you can change this to your priority preference.Continue reading to learn how to integrate the To-Dos with a Mail.app mail rule.

  • AppleScript: Integrating shell scripts

    by 
    Cory Bohon
    Cory Bohon
    06.23.2008

    We've talked about AppleScript how-tos before. AppleScript is fun and all, but what if you already know how to write shell scripts? Well, did you know that by integrating shells scripts into AppleScript, you can create simple applications that do useful things? It's true, and I am going to show you how. Continue reading to learn how to integrate shell scripts into AppleScripts.

  • Mac Automation: Burn a backup disc of recent iPhotos

    by 
    Cory Bohon
    Cory Bohon
    06.17.2008

    Time Machine is great way to backup your entire Mac, but what if you want to make a single backup of your recently imported photos in iPhoto? Well, Automator for Leopard is here to help with this task. In this how-to, I will show you how to find photos taken in the last 2 months and burn the resulting photos to a disc for safe keeping. Continue reading to learn how to create this Automator workflow.

  • Mac Automation: Using variables in Automator

    by 
    Cory Bohon
    Cory Bohon
    06.11.2008

    Last week I showed you how to use Automator to make a workflow that took photos from your Mac with an iSight and sent them to your Apple TV. That how-to featured one way of using a variable in Automator to let the user name the photo themselves. In this week's Mac Automation post, I want to go into a little more detail on what variables are and what they can do for your Automator workflows. Continue reading to learn more about using variables in Automator.

  • Mac Automation: take and sync pictures to Apple TV

    by 
    Cory Bohon
    Cory Bohon
    06.02.2008

    Parties can sometimes be boring, but with a Mac with an iSight and an Apple TV, you can liven up any party! In this how-to, I am going to show you how to create an Automator workflow that will take pictures at specified times and sync them over to your Apple TV, all without you ever lifting a finger. This Automator workflow is fantastic when you have people over for a party they can head over to your Mac, take a crazy picture of themselves and have it synced over to the Apple TV in the living room. Continue reading to learn how to make this Automator workflow.

  • Mac Automation: E-mail songs from iTunes

    by 
    Cory Bohon
    Cory Bohon
    05.27.2008

    What do you do if you need to email a song from iTunes to your work computer, or to another machine you own? If you have one machine where you do all your CD imports, you might want to send a track to the office; maybe you've got your GarageBand compositions in iTunes and you want to send one to a friend. We can simply this process by using Automator for Leopard. In this how-to, I am going to show you how to quickly and easily e-mail songs from your iTunes library.Continue reading to learn how to e-mail songs using Automator.

  • Mac Automation: Get remote screenshots via Mail

    by 
    Cory Bohon
    Cory Bohon
    05.19.2008

    I've talked about getting your Mac to shutdown via an e-mail (or even take a picture from your iSight and e-mail it back to you), but I have received some comments and e-mails about using this script to send a snap of your computer screen when you want to "check up." So, in this Automator tutorial, I am going to show how to get a screenshot of your Mac no matter where you are -- via e-mail.Continue reading to learn how to generate screenshots via Mail.

  • AppleScript: Print daily iCal agenda

    by 
    Cory Bohon
    Cory Bohon
    04.28.2008

    var digg_url = 'http://digg.com/apple/TUAW_Use_an_AppleScript_to_have_iCal_deliver_a_daily_agenda'; If you use iCal to store you important dates and events, and use it on a regular basis without syncing events via an iPod, iPhone, or other device, then you know how frustrating it can be when you forget about an appointment or event. I'm going to show you a way to automatically print your daily iCal agenda with a simple AppleScript. You can set this script to run when your Mac starts up so you never miss an appointment!Continue reading to learn how to create this AppleScript.

  • Mac Automation: create a Mail-triggered "spy cam"

    by 
    Cory Bohon
    Cory Bohon
    04.22.2008

    Have you ever been away from your Mac, then come back only to find that your co-worker has stolen your favorite Apple pen? Well, I am going to show you how to catch them in the act by creating a Mac "spy cam." For this how-to, you will need to create an Automator workflow, AppleScript, and some Mail rules. So, cue the James Bond music, and let's begin. You do need an iSight or a newer Mac with a built-in camera. (Yes, I know there are some tools prebuilt to do this -- but what's the fun in that?)Continue reading to learn how to create the Mac spy cam.

  • Mac Automation: automating Microsoft PowerPoint 2008

    by 
    Cory Bohon
    Cory Bohon
    03.26.2008

    Welcome to the 3rd Microsoft Office 2008 automation post. Previously we covered automating Excel 2008 and Word 2008, now we shine the spotlight on PowerPoint 2008. In this how-to, I will show you how to create an Automator workflow to automate the daunting task of applying animations to the slides and converting a presentation into a QuickTime movie file. For this workflow, you'll need the following Automator actions (in the same order): Apply Animation to PowerPoint Slide Parts Convert PowerPoint Presentations to Movies Play Movies Continue reading to learn how to create this workflow.