automator

Latest

  • Workflow

    Apple acquisition hints at deep automation in iOS

    by 
    Jon Fingas
    Jon Fingas
    03.22.2017

    You've had a number of built-in options to automate tasks on the Mac over the years, such as AppleScript and Automator, but you've had to turn to third-party apps like IFTTT to do similar things on iOS. You might not have to lean so much on outside help going forward, though. Apple has confirmed that it just acquired Workflow, an app that lets you easily run multi-step, multi-app tasks from your iPhone or iPad. You can upload your latest photo to a cloud service by pushing a button, for instance, or tell a family member when you expect to get home.

  • Automate your iOS life with Workflow

    by 
    Steve Sande
    Steve Sande
    12.11.2014

    In the beginning, there was DeskConnect. It was an amazing set of apps that gave the pre-iOS 8/Yosemite world the ability to do AirDrop-style transfers between Macs (and PCs) and iOS devices. It's still around for those who haven't yet upgraded to the new operating systems. But it appears that the developers at DeskConnect saw the Sherlock writing on the wall, so they decided to create an app that is -- in one word -- amazing. Workflow (launch price of US$2.99, regularly $3.99) is an app for creating automated workflows on your iOS devices that can do just about anything you can think of. Upon launching for the first time, Workflow takes you through a short tutorial to demonstrate the process of creating a very simple workflow -- having the iPhone or iPad camera take three pictures, turn them into a GIF movie, and then share the GIF. Doing this is easy; you create a blank workflow, then begin dragging actions from a huge list (153 built into the app at launch) over to that blank sheet. All of this is done with simple, colorful drag and drop interface. Actions are categorized by type: calendar, contacts, documents, maps, music, photos & video, scripting, sharing, text and web. For example, under calendar you'll find actions like "Get end date" and "Current date"; under maps, a way to get a Google Street View image of a location or request an Uber. Web actions include adding something to your Safari reading list, or getting contents of web pages. Music can control music play, or return the title of the currently playing song to Workflow. Probably the most powerful actions, however, are those for scripting. Have you ever wanted Apple's Automator on your iOS device? The scripting actions in Workflow are the next best thing, and the ability to control the flow through choose from menu/if/repeat/wait/exit commands actions brings conditionals to your workflows. There's device control in those scripting actions as well; a workflow can return the name of the current network, launch an app, set the screen brightness, turn on or off the "flashlight", or set the volume of the device. Notifications can be scripted -- showing alerts, notifications, playing sounds or vibrating your device. And it's not just limited to your iOS device, either -- you can run a shell script on a desktop machine over SSH. Workflows can be standalone "apps" that you can add to your home screen, or you can create Action Extension workflows that run in the share sheets of other apps. If you've created a workflow that is useful and you're proud of, you can share it with others through the Workflow gallery. There's probably nobody on the planet who can explain iOS scripting better than the creator of MacStories.net, Federico Viticci. Viticci had pre-release access to Workflow and as such, was able to create a number of workflows that he's shared -- including "Print to PDF" (an Action Extension), "Find Lyrics", and more. I used the Print to PDF extension to save his Workflow Review to PDF, because I'll want to keep it around for reference in the future. For myself, I wanted to create a workflow that would take recipes I've found on the web, convert them to PDF, and then save them to a Dropbox folder. Since there was already a Print to PDF Action Extension (thank, Federico!), I grabbed that one to start off with, changing the name to "Send Recipe to Dropbox" and using the built-in library of glyphs to make a "utensils" icon. The only thing I really needed to do was get rid of the Quick Look action and replace it with a Save to Dropbox action. That action asked for access to my Dropbox account, and there was a choice to either have it ask which Dropbox folder to save the recipe to or set a predefined path. I chose the latter, saved and ran the extension from Safari while looking at a recipe on a food website, and seconds later that recipe was sitting in Dropbox. That Save to Dropbox action is one of many that link with existing apps or services, and it's expected that many developers will open their apps to Workflow. Personally, I'm hoping for a "Grab Screenshot" action, since I already have a workflow idea that could use it. Another quick Workflow I developed expanded on "Print to PDF" by creating a PDF, then asking through a menu whether I want to store it to Dropbox or a folder in iCloud Drive. I could just as easily have it save to both services with a few easy edits. Since I've only had a handful of hours to work with Workflow, I can't get into the details that Federico Viticci did. I highly recommend that anyone with interest in iOS automation and Workflow in particular take a look at his post over at MacStories.net. In those few hours that I've been able to test Workflow, it's already earned a space on my Home Screen as a standalone app rather than being put into a folder. Being able to create your own "apps" and extensions is an amazingly powerful tool to add to any operating system, and DeskConnect should be commended for creating a 1.0 version that works so well. Workflow deserves a place on your iPhone or iPad; it's a universal app that requires iOS 8.0 or later, and is optimized for iPhone 5, 6 and 6 Plus.

  • AppleScript and Automator gain new features in OS X Mavericks

    by 
    Steve Sande
    Steve Sande
    10.23.2013

    Mac power users love to play with scripting and automation. If there's something that's repetitive that needs to be done, it's a lot easier just to either use Automator to automate the process or write an AppleScript to dive in a little deeper. With OS X Mavericks, it appears that Apple has added some features that will help "self-developers" who want to add their own capabilities to their Macs and commercial apps. On the other hand, there are fewer scriptable items available in many of the new Apple apps... iCloud Sync To begin with, there's a surprise for anyone who launches either Automator or AppleScript Editor. The first thing you'll find is that both apps were updated with iCloud compatibility. AppleScripts that you've created or Automator workflows can now be moved into the cloud and synced to all of your Macs that are running OS X Mavericks. Sure, that's a little thing, but it's useful if you're creating and updating scripts or workflows that need to be deployed to a handful of Macs automatically. Notifications Want to annoy yourself? AppleScript and Automator now includes a Display Notification command that you can use to send yourself notifications from your own scripts. That's actually quite useful if you want to write a script or run an Automator action that's going to ping you when it's done through Notification Center. There's got to be a way to use this to annoy coworkers... Libraries Now this is cool. Let's say that you have code that can be used in a number of scripts. Now you can create an AppleScript Library, which is a script that contains a frequently used routine. Store that in ~\Library\Script Libraries\, and now any other script can use that code by simply calling it with a new use clause. Write once, use many times. Blogger Don Southard over at MacStories has a good example of how to use libraries in his writeup of scripting and automation improvements in Mavericks. Code Signing This may not sound like a big thing, but it's huge. Apple developers can now generate signed copies of applets and droplets as part of the export process in both AppleScript and Automator. Signing these applets means that users launching them will not get the usual Gatekeeper security warning, and adds an incentive for developers to include easy automation tools in their solutions. Speakable-Workflows Now here's a wonderful addition for those who are creating accessible solutions. If Speakable Items is activated in the Accessibility system preferences, Automator adds a new option to the save dialog to save applets as Speakable Items. With that one click, those items are saved to the Speakable Items architecture and can be executed by speaking the name of the applet. Now, about those new apps... On the bad side, some of the new apps appear to be missing a lot of commands in their dictionaries. For example, opening the dictionary of Pages '09 displayed the following: Compare that to the new dictionary for the current iteration of Pages: What's missing? Well, a lot. The Pages Application Suite used to let you do things like script the addition of a chart or table to a document; the Graphics Suite made it easy to script changes to things like the alpha threshold of an image; and the Text Suite even allowed scripting of things like inserting a table of content to a Pages document or fine-tuning the look of character styles. Can't do that with the new Pages... Hopefully Apple will add these capabilities back in an update to Pages and the other iWork apps. (Thanks to reader Peter P. for noting this omission from Pages.) This is just what I've been able to find -- or not find -- in a cursory look at Maverick's automation tools. As more capabilities and deletions become apparent, this post will be updated. I'd also recommend taking a look at MacOSXAutomation.com, which is always helpful and useful when you're considering the use of the built-in OS X automation tools.

  • Triggering AppleScripts from Calendar Alerts in Mountain Lion

    by 
    Ben Waldie
    Ben Waldie
    03.18.2013

    AppleScripts are great tools for increasing your daily productivity. They're even better when they can be set to run unattended, at night, on weekends or during downtime. In Lion, iCal included a handy option for attaching a script to a calendar event. Just create an event, add a Run Script alarm, point it to the desired script and you're good to go. Things changed in Mountain Lion, though. Presumably for security reasons, the Run Script alarm option was removed from the Calendar app. Despite its removal, however, there are still some ways you can trigger scripts from Calendar events. iCal event alarm choices in OS X 10.7 Lion Calendar event alarm choices in OS X 10.8 Mountain Lion Use Automator to Trigger Your AppleScript Although Apple removed the Run Script alarm option in the Calendar app, Automator's ability to save Calendar Alarm workflows wasn't removed. And, since Automator workflows can trigger AppleScripts, they offer a quick and easy workaround for scheduling scripts. Start by launching Automator and creating a new Calendar Alarm workflow. To schedule an Automator workflow, choose the Calendar Alarm template. To Trigger an AppleScript App If your script is an app, you just need to set the workflow to launch it. Add the Launch Application action to the workflow. From the application popup menu, choose Other... and navigate to your saved AppleScript app. The Launch Application action can be used to launch an AppleScript app. To Trigger AppleScript Code If you'd rather not create an app (an app + your Automator workflow means more files to manage), you can embed compiled AppleScript code right within your workflow. Find the Run AppleScript action and drag it to the workflow. Then, insert the desired script code into the action. The Run AppleScript action can be set to run code embedded in your Automator workflow. To Schedule the Script Once you've got your workflow configured, go ahead and save it. Automator automatically adds it to an Automator calendar (which is created if it doesn't exist yet) in the Calendars app. An Open File alarm is added to the event and set to run the workflow. Now, adjust the start date of the event as needed, put it on a repeating schedule, etc. Open File alarms are used to trigger Automator Calendar Alarm workflows. Use AppleScript to Create a Scheduled Event If you create an event in the Calendars app and add an Open File alarm, you should find that you're unable to select a saved AppleScript app. You can select a compiled AppleScript file, but this is essentially useless because when the event triggers, the Open File alarm simply causes the compiled script to open in AppleScript editor. Not what you need. What you really need is to open a saved script app. AppleScript to the rescue. To work around the limitation, just run the following script. It asks you to select a saved AppleScript app. It then creates an event at the current date and time on an AppleScripts calendar, which it creates if it doesn't exist already. The script then adds an Open File alarm to the newly created event and sets it to open your selected script app. Yep, that's right. Although you can't manually set an event to open a saved AppleScript app, you can script the process. NOTE: You can download the complete script below here. So, there you go. A number of workarounds for triggering scripts from Calendar events in Mountain Lion. So, schedule away! Happy Scripting!

  • Alfred v2 brings Workflows, automates what Automator might not

    by 
    Jon Fingas
    Jon Fingas
    03.15.2013

    Anyone who's heavily invested in the Mac ecosystem knows Automator, a built-in tool that can string together multiple computing actions without having to know a lick of code. Some of us may want a little more power, or just a different variety of power -- which is where the recently launched Alfred 2.0 comes in. Those who buy the £15 ($23) Powerpack can take advantage of Workflows, which relies on an Automator-like concept of linking simple actions to run complicated tasks. They can be more ornate than you'd expect, however: for a start, you can run multiple app-specific tasks in parallel, such as telling Chrome to search YouTube, IMDB and Rotten Tomatoes the moment you type in a movie keyword. It's equally possible to feed results back to Alfred, launch scripts and trigger notifications (whether Mountain Lion's or Growl's), among other feats. Should you demand control that sits just outside of Apple's boundaries, Alfred is waiting at the source link; anyone who just wants its core launcher functionality can grab the app for free.

  • More Tips for Troubleshooting Automator Workflows

    by 
    Ben Waldie
    Ben Waldie
    03.11.2013

    In my last post, I shared some useful tips for troubleshooting Automator workflow problems. I didn't cover everything, though. There are lots of other ways you can troubleshoot your workflow. Here are some more tips to help. 1. Use Get Selected Finder Items Wisely Automator workflows are frequently created to process files and folders. When you save a workflow as an application, you can drag files and folders onto it and they're passed right into the workflow for processing. Other types of workflows behave similarly. Save a Folder Action workflow, for example, and every time new items are added to the folder, they're automatically passed to the workflow for processing. At the top of a workflow, Automator tells you if it receives files and folders as input. From time to time, however, you may notice that your workflow has processed your files twice, or that it's encountered some kind of obscure error. Often, this is due to the presence of a Get Selected Finder Items action at the beginning of the workflow. As enticing as its name sounds, the Get Selected Finder Items action isn't always needed to process files and folders. Remember, depending on the type of workflow you built, those items may be passed automatically to your workflow. In these cases, the inclusion of the Get Selected Finder Items action causes the dropped items to be appended to themselves. This can result in the items being processed twice or an error. So, what's the solution? Just try removing the Get Selected Finder Items action from the beginning of your workflow. Many times, that one simple change fixes the problem. Don't insert the Get Selected Finder Items action at the start of a workflow if your workflow already receives Finder items as input. 2. Finding Missing Output Files Imagine this. You run an Automator workflow that takes a PDF and outputs its pages as images. The only problem is that the images never seem to show up. Sound familiar? If you've ever been unable to find files output by a workflow, it may not necessarily mean that your workflow failed. Those files may actually be buried somewhere on your system. This is because some Automator actions generate their output files in hidden temporary folders. The Render PDF Pages as Images action is one example. It extracts the pages of a PDF as image files, gives them unique names, and saves them into a hidden temp folder. Render PDF Pages as Images sneakily outputs files to a hidden folder. Note that it doesn't have an option to select an output folder. To determine whether this has happened, run your workflow in Automator. Then, open the action's Results area. If there are files or folders listed, you should be able to figure out where they're located by viewing them in list view. An action's Results area tells you if an action really produced a result. To output the files or folders to the desired location, just insert a Move Finder Items action into your workflow. This should move the items from their secret location to the Desktop or wherever else you choose. Use the Move Finder Items action to move hidden output files someplace more useful. 3. Improving Recorded Task Playback A great feature of Automator is its ability to record things you do manually, so you can play them back later as part of your workflow. A not so great feature of Automator is its knack for being unable to play back what it records. There are a number of reasons this can happen, and some options for fixing things. You may have made a mistake while recording. Remember, Automator is watching. So, it picks up your mistakes too. If this happens, try selecting the extra steps in the Watch Me Do action Automator adds to the workflow. Then, press the Delete key to remove them. You can remove recorded steps by selecting and deleting them. You may have moved too fast, and Automator couldn't keep up. It may have missed some of what you did. You can try to resolve the problem by recording the steps again. This time, take your sweet time. Automator may be unable to repeat what you did manually. Unfortunately, Automator can't access everything in OS X. It can access a lot, but not everything. If this happened, consider trying a third-party macro utility, such as iKey. It may have greater reach than Automator. 4. Locating Missing Actions If you've ever launched Automator but have been unable to locate an action that you used in the past, it may not mean that action is entirely gone from your Mac. Automator may just be unable to load it for some reason. For example, maybe the app the action works with isn't installed anymore. You can see what Automator is unable to load by checking the Console app (in /Applications/Utilities). Just open it up, launch Automator, and see what shows up in the Console. The Console app tells you what actions Automator can't load. Here, the Entourage actions weren't loaded because I don't have Entourage installed anymore. I now have Outlook installed. 5. Service Workflows Not Triggering? Have you created service workflows, but when you trigger them, they don't seem to run? Give them some time. For whatever reason, they may take some time to get going. After one has run, however, subsequent service workflows should run a bit faster. You may have also noticed that you can assign keyboard shortcuts to Service workflows. If you haven't noticed this, you can do it in System Preferences > Keyboard > Keyboard Shortcuts. Assigning a keyboard shortcut to a Service workflow Once you've assigned a keyboard shortcut, you may have found that the workflow doesn't run when you press the keyboard shortcut. One possible fix is to manually choose the workflow from the application's Services menu. Then, once it's been triggered for the first time, the keyboard shortcut often starts working again. Hopefully, these tips and my prior tips have put you on the path to more stable and reliable workflows. Good luck and Happy Scripting!

  • Tips for Troubleshooting Automator Workflows

    by 
    Ben Waldie
    Ben Waldie
    03.04.2013

    Automator's great for streamlining time consuming and repetitive tasks on your Mac. It's easy. Just launch it, find a few actions, and string them together to form a workflow. Then, run your workflow anytime you want to perform that series of tasks again. What happens if your workflow doesn't run as you expect, though? Finding and solving problems in Automator is often easier said than done. Suddenly, the simple tool that's supposed to make your life easier has become a real pain in the neck. This week's post covers some things you can do to troubleshoot a finicky Automator workflow, track down the problem, and hopefully solve it, so you can get back to work. 1. Run Saved Workflows in Automator Automator workflows are saved and run in a variety of ways - as apps, iCal alarms, print plugins, and more. When a saved workflow encounters a problem, however, it may be next to impossible to figure out what went wrong. This is because saved workflows don't really include any diagnostic tools. In some cases, the workflow may even fail silently, without alerting you that something is wrong. Your only indication of a problem may be a lack of the end result you were expecting. Not very helpful, especially in a longer multi-action workflow. When you encounter a problem with a saved workflow, your best bet is to open up the workflow in Automator, and try running it there. By doing so, you'll gain access to some of the techniques described below. 2. Fake Workflow Input When you run a workflow app or plugin within Automator, you may see an alert indicating that the workflow will not receive input. An Automator Input Alert for a Text Service Workflow This is because, often, saved Automator workflows expect input for processing. For example, a workflow app may expect dropped files or folders as input, a service workflow may expect text as input, or a print plugin may expect PDF files from the print system. In any case, just dismiss the alert and add an action to the beginning of the workflow to retrieve the required type of input. If your workflow processes files, for example, add a Get Specified Finder Items action. If your workflow processes text, add a Get Specified Text action. Whatever you add, just be sure to remove it once you're finished troubleshooting. Get Specified Text at the Beginning of a Text Service Workflow 3. Check Action Results Automator works by passing information to actions for processing. Most actions perform a very specific function. As such, they accept specific types of information as input. And, they produce different types of output. The New TextEdit Document action, for example, wants text as input. It then adds this text to a new TextEdit document, and passes the document as output for further processing. Often, when a workflow fails or produces an undesired result, it's because actions aren't receiving or producing the expected types of information. To diagnose this problem, click the Results button beneath each action in your workflow. Then, when you run the workflow, you can see exactly what information is being passed from action to action. Suppose, for example, I have a workflow that should take the contents of a text file and add it to a new TextEdit document. I may try creating my workflow with the following actions: Get Specified Finder Items - Configured to get a text file Filter Paragraphs - Configured to look for non-empty paragraphs New TextEdit Document All the actions appear to link up properly, and the workflow may even run without an error. But, the result is not what I want. Rather than the content of the text file being added to the new TextEdit document, the path of the document is added. A Misbehaving Text Workflow An Undesired Workflow Result By displaying the result area of each action in the workflow, I can see that a file path was passed to the Filter Paragraphs action as input. I can also see that the same file path was output by the action, rather than the paragraphs I was expecting. This tells me that there's something wrong with the Filter Paragraphs action. Action Results Indicate Potential Problems Checking the action's description area provides additional clues. It tells me the action expects text as input, not files. Action Descriptions Specify Input and Output Types So, in this case, the fix is to insert an action that outputs text, rather than files, before the Filter Paragraphs action. NOTE: Surprisingly, Automator doesn't include an action for reading text from a file. There are third-party actions available that can do this. Or, as a workaround, you can try using the Combine Text Files action, which receives one or more files as input and outputs their text content. 4. Check Automator's Log Checking the results of an action doesn't always tell you what went wrong. You may glean a little more information by consulting Automator's log area. Press Command+Option+L or choose View > Log to display it. When you run a workflow, the log area tells you which actions ran, and often indicates problems that were encountered along the way, such as an action that wasn't supplied with the appropriate type of input. Automator's Log Area Indicates Successes and Failures Sometimes, the log tells you that information was converted from one type to another. This is because, in some cases, Automator tries to make incompatible actions work together. This doesn't always work, however, and can result in an error. So, be on the lookout for failed conversions. 5. Step Through Workflows Running a workflow and checking action results is great, but it's even more useful to check the results of each step of your workflow as it happens. You can do this by stepping through the workflow step by step. Click the Step button in the workflow's toolbar or select Workflow > Step from the menu bar. Automator's Step Button The above techniques may not resolve every problem you encounter with Automator, but they will certainly help you to more easily identify solutions for some. Happy Scripting!

  • Mac 101: Use Automator to extract text from PDFs

    by 
    Matt Tinsley
    Matt Tinsley
    02.11.2013

    More Mac 101, tips and tricks for novice (and expert) Mac users. Have you every tried to copy and paste text from a PDF into a word processor document like Pages or Microsoft Word? Most of the time the text loses all its formatting from the PDF, which can be a real pain. Too often I've spent a frustrating amount of time putting text back into a coherent order after copying it from a PDF, while wondering why there isn't a simpler way of doing this on my Mac. Thankfully, a friend (who discovered how to from MacWorld) showed me, using Automator. And provided the text in the PDF is formatted correctly (and you're not trying to extract text that is actually an image), it's foolproof as well as free! Here's how. On your Mac, open Automator from Applications. Automator will ask you to select a type for your document. Select Workflow, then hit return. In the far-left column of Automator, click on Files and Folders. In the second column, select Ask for Finder Items and drag and drop it into the far-right space which reads "Drag actions or files here to build your workflow." This becomes your first action. Now click on PDFs in the far-left column and select Extract PDF Text from the second column. Drag and drop Extract PDF Text into the space to the right, where you dragged Find Files and Folders. You'll now see that Automator has created a workflow or one action following another. You're almost there. In the Extract PDF Text bubble of the workflow, select Rich Text instead of Plain Text (next to Output -- this will retain formatting like italics and bold) and choose where you want Automator to place your extracted text files from Save Output To. To finish, simply title and save, but make sure you've save as an application and not a workflow. Now open your new Automator application and select the PDF you want to grab the text from. A new Rich Text document will be created. From there, simply open this document and copy and paste the text into your preferred word processor.

  • AppleScripting Notification Center > Scheduling Do Not Disturb

    by 
    Ben Waldie
    Ben Waldie
    02.04.2013

    Mountain Lion's Notification Center is great for keeping you in the loop, but it can be a huge distraction when you need to get stuff done. Sometimes, a little peace and quiet is all you need to stay productive. As you may know, iOS 6 includes a handy Do Not Disturb feature, which can be turned on to disable notifications. It can even be set to automatically enable/disable itself at scheduled intervals. Mountain Lion also lets you disable Notification Center. Just open Notification Center and drag down to access a Show Alerts and Banners toggle switch. Note that this is a temporary setting, and disabled notifications automatically re-enable at midnight. Unlike iOS 6, though, Mountain Lion doesn't give you an option for enabling/disabling notifications on a schedule. At least, it doesn't provide a built-in option for this. With a little customized help from AppleScript, Automator, and the Calendar app, it is possible. In this post, you'll create two Calendar Alarm Automator workflows, which can be configured to run at scheduled times to enable or disable Notification Center alerts and banners. Note: If you have any trouble following along, you can download the completed AppleScripts and Automator workflows here. Building a Workflow to Enable Do Not Disturb (i.e. Disable Notification Center Alerts and Banners) 1. Launch Automator (in your /Applications folder) and create a new Calendar Alarm workflow. 2. Search the action library for the Run AppleScript action and drag it to the workflow area. 3. Replace the pre-filled AppleScript code in the Run AppleScript action with the following: The script writes to Notification Center's property list file and enables Do Not Disturb mode. It then quits and relaunches Notification Center in order for the change to go into effect. 4. You're finished building the workflow, so go ahead and save it as Enable Do Not Disturb. 5. When you save the workflow, Automator puts it where it needs to go (the ~/Library/Workflows/Applications/Calendar folder). The Calendar app launches and a new event is created in an Automator calendar, which Automator creates if it doesn't already exist. The event should be configured with an Open File alarm that's set to run the workflow. Schedule the event for the desired time, such as every weekday morning at 6 AM. Now, every time the event occurs, the alarm should launch the workflow and Notification Center should be disabled. As I mentioned earlier, Notification Center automatically re-enables each day at midnight. So, if you plan to schedule Do Not Disturb overnight, then you'll need to create an additional event that disables it again at 12:01 AM. Building a Workflow to Disable Do Not Disturb (i.e. Re-Enable Notification Center Alerts and Banners) Now that you've got a workflow to disable Notification Center, you probably want one to re-enable it. 1. Create another new Calendar Alarm workflow in Automator. 2. Search the action library for the Run AppleScript action again and drag it to the workflow area. 3. This time, replace the existing placeholder script in the Run AppleScript action with the following code: This code updates Notification Center's property list file to disable Do Not Disturb. Then, it relaunches Notification Center for the change to take effect. 4. The workflow is done, so save it as Disable Do Not Disturb. 5. The Calendar app should launch again and another event should be added to the Automator calendar. This event should be configured with an Open File alarm that's set to open the Disable Do Not Disturb workflow. Set it to run on the desired schedule, such as every weekday morning at 9 AM. If everything has gone according to plan, you should now have Do Not Disturb workflows that disable and re-enable Notification Center alerts and banners at the desired times. Use your alert-free time wisely. Until next time, happy scripting!

  • Use Automator to get the Airport Utility 5.6.1 working on OS X 10.8

    by 
    Megan Lavey-Heaton
    Megan Lavey-Heaton
    01.22.2013

    When I acquired a second printer dedicated to making prints and photos, I decided to dig the older Airport Express I have out of a drawer and set it up to be a wireless print server for that printer. However, I ran into a bit of a snafu: the older Airport Expresses require AirPort Utility 5.6.1 to run. It's still available on Apple's website, but even though it's easy to obtain, you can't run it in Mountain Lion. The actual AirPort Utility 5.6.1 software runs just fine on Mountain Lion. Its installer, however, isn't compatible. The solution I initially discovered, thanks to Douglas Urner in the Apple support communities, was to use Terminal to extract the AirPortUtility.pkg from the installer and dig the app out of it. It worked great, and it nets you a working copy of AirPort Utility 5.6.1. But UI designer Frank Tisellano makes this even easier. He developed an Automator workflow does all the coding work for you. This is the solution for those who aren't comfortable with diving into the inner workings of your Mac. Here's what to do: Download the AirPort Utility 5.6.1 installer from Apple. Download Tisellano's workflow from his website. Drag the AirPort Utility installer file onto the extracted workflow item. Don't just run the workflow, otherwise it won't work properly. Authorize any permissions needed and let the workflow do its magic. Once it's finished, you'll see an AirPortTemp and the older AirPort Utility sitting on your desktop. Move the AirPort Utility to your Utilities folder, trash the other folders, and you're good to go!

  • AppleScripting OmniFocus: send due tasks to iTunes

    by 
    Ben Waldie
    Ben Waldie
    01.14.2013

    OmniFocus is a great tool for keeping us organized. But, let's face it. We're busy people. That's why we need a task management app in the first place. How can you take your productivity to the next level? How about having your daily OmniFocus tasks read to you as you drive to work? With a little help from AppleScript and Automator you can make that happen. Here's how... Setup In order to run this script and workflow, you'll need to make sure you have an OmniFocus perspective named Due, and that it's set up to display any tasks that are considered Due Soon. This is a default perspective, so you probably already have it. You can adjust what's considered Due Soon in the Data section of OmniFocus' Preferences window, under Dates & Times. Building the Workflow Note: If you get stuck or have trouble following along, you can download the complete AppleScript and Automator workflow here. 1. Launch Automator and create a new iCal Alarm workflow. Creating an iCal Alarm workflow in Automator 2. Find and add the Run AppleScript action to the workflow, and enter the following AppleScript into the action's script area. When run, this script opens OmniFocus, displays the Due perspective, retrieves a list of tasks, and generates an audio file on the Desktop. The Run AppleScript action handles the OmniFocus work 3. Add the Import Audio Files action to the workflow, and set it to Delete source files after encoding. This action imports the audio file and cleans up afterward 4. Insert the Add Songs to Playlist action. Set it to add to a New playlist named OmniFocus. This action adds the imported audio file to the OmniFocus playlist. It only creates it if it doesn't already exist. 5. Save the workflow as OmniFocus > Send Due Tasks to iTunes. When you do this, iCal opens and a new event is added to an Automator calendar, which is created if it doesn't already exist. The event is configured with an Open File alarm set to run the workflow. Saving the workflow puts it in the proper location and automatically creates an iCal event 6. Set the workflow to run each day at the desired time. You can set the workflow to run anytime you want Once configured, the workflow should run as scheduled. When it does, it should retrieve list of your OmniFocus due tasks, convert them to audio, and import them into an OmniFocus playlist. Example Due tasks in OmniFocus The imported audio task list can be added to your iPhone for on-the-go access

  • Preparing high-res icon files with Automator

    by 
    Ben Waldie
    Ben Waldie
    12.31.2012

    This week's post is for all those Mac app developers out there. If you're not an app developer yet, it's a new year, and I'm sure becoming an app developer is at at the top of your resolution list. In any case, if you plan to develop apps, then you need to prepare icons for those apps. Apple provides very specific requirements for generating high resolution icons, which you can find listed on the Apple Developer Connection website. In the past, Xcode came with a tool named IconComposer, which could be used to generate icon files. This tool, however, didn't generate high res icon files, so Apple now discourages its use. Instead, Apple provides instructions for generating icons using an iconset, a folder of image files that can be converted to an icon file using either Xcode or the iconutil command line tool. There are, of course, other ways of creating icons. In this post, however, we'll focus on an iconset. To manually generate an iconset folder, you start by creating a square image to serve as your icon. Next, you generate versions of the image scaled to 16x16, 32x32, 128x128, 256x256, 512x512. These scaled versions are to be named as follows: icon_16x16.png icon_16x16@2x.png icon_32x32.png icon_32x32@2x.png icon_128x128.png icon_128x128@2x.png icon_256x256.png icon_256x256@2x.png icon_512x512.png icon_512x512@2x.png You place all of these images into a folder named FolderName.iconset. Then, you can process it with iconutil to generate an icns file. Sure, creating scaled images and processing them isn't too difficult, but it's a lot of repetitive work. If you create icons regularly, it can get tedious. You're probably thinking, surely, Automator can be used to streamline the process. It can. Here, we'll create an application workflow you can run anytime you want to convert an image to an icon file. Let's get started... Note: If you're an iOS developer, feel free to adjust the workflow below accordingly. Creating the Workflow Launch Automator and create a new Application workflow. Next, insert and configure the following actions. Note: This workflow is pretty long and repetitive. It's easy to get lost. If you get stuck, don't worry, you can download the complete workflow here, along with a sample icon image. 1. Ask for Finder Items - Set this action to ask for an image file at least 1024x1024 in size. 2. New Folder - Set this action to create a folder named MyIcon.iconset on your Desktop. 3. Set Value of Variable - From the popup menu in this action, choose New Variable and create a variable named iconset folder. 4. Get Folder Contents 5. Change Type of Images - Set this action to convert images to PNG format. 6. Scale Images - Set this action to scale the image to a size of 1024 pixels. 7. Rename Finder Items - Set this action to name a single item's basename only to icon_512x512@2x. This represents a 1024 image (i.e. a Retina display ready size) when the icon is created. Note that this action's title changes in the workflow to reflect the type of naming, in this case Name Single Item. 8. Duplicate Finder Items 9. Scale Images - Set this action to scale the image to a size of 512 pixels. 10. Rename Finder Items - Set this action to name a single item's basename only to icon_512x512. 11. Duplicate Finder Items 12. Rename Finder Items - Set this action to name a single item's basename only to icon_256x256@2x. 13. Duplicate Finder Items 14. Scale Images - Set this action to scale the image to a size of 256 pixels. 15. Rename Finder Items - Set this action to name a single item's basename only to icon_256x256. 16. Duplicate Finder Items 17. Rename Finder Items - Set this action to name a single item's basename only to icon_128x128@2x. 18. Duplicate Finder Items 19. Scale Images - Set this action to scale the image to a size of 128 pixels. 20. Rename Finder Items - Set this action to name a single item's basename only to icon_128x128. 21. Duplicate Finder Items 22. Scale Images - Set this action to scale the image to a size of 64 pixels. 23. Rename Finder Items - Set this action to name a single item's basename only to icon_32x32@2x. 24. Duplicate Finder Items 25. Scale Images - Set this action to scale the image to a size of 32 pixels. 26. Rename Finder Items - Set this action to name a single item's basename only to icon_32x32. 27. Duplicate Finder Items 28. Rename Finder Items - Set this action to name a single item's basename only to icon_16x16@2x. 29. Duplicate Finder Items 30. Scale Images - Set this action to scale the image to a size of 16 pixels. 31. Rename Finder Items - Set this action to name a single item's basename only to icon_16x16. 32. Get Value of Variable - Set this action to get the iconset folder variable you created way back at the beginning of the workflow. You also need to set this action to ignore its input, so it doesn't continue processing the 16x16px image from the previous action. Select Action > Ignore Image. 33. Run Shell Script - Set this action to pass input as arguments. Then, enter the following command: iconutil -c icns "$@" Preparing the Run the Workflow Before you begin running the workflow, you need an image you can convert to an icon. Note that iconutil requires this image to be square. So, make sure it is. If you really want to be sure it's square, you can insert a Crop Images action between steps 5 and 6, and configure it to crop to 1024x1024, scaling to the shortest side before copping. However, if your image contains transparency, this action will remove it. So, it's best to prepare your starting image as a square. Running the Workflow When you run the workflow, you're first asked to choose an image. Select the desired image and click Choose. The workflow runs, an iconset folder is created on your Desktop and passed to iconutil, which generates an icns file. You're ready to plug your icns file into your app. Now, any time you need to generate an icon, just create a square image and trigger your workflow. Happy New Year and Happy App Developing!

  • Where Automator Actions and Workflows Live

    by 
    Ben Waldie
    Ben Waldie
    12.17.2012

    Automator's great for streamlining some of the repetitive things you do each day on your Mac. With Automator, you can create your own custom plugins for the Services menu, Folder Action workflows that run when files are placed into a folder, add-ons for the print window's PDF menu, and more. In most cases, when you save a workflow, Automator puts it where it needs to go automatically. But, where do your workflows actually live? If you want to remove or edit one, you'll need to know. In this post, we'll take a look at the various places workflows are found on your Mac. Actions Before exploring the different resting places for workflows, let's discuss actions. Actions are the building blocks of your workflows. To use them, they need to be installed somewhere Automator can find them. There are four places actions can reside on your Mac: Apps - Often, an app that supports Automator contains embedded actions. When Automator launches, it scans the apps on your Mac, loads their actions (if they have any), and displays them in the action library. Aperture is an app that contains embedded Automator actions /System/Library/Automator - This is where Apple puts all of the standard actions that come with OS X, such as actions for Calendar, Mail, and Safari. /Library/Automator - Here, you may find some non-embedded third-party actions. The Microsoft Office actions, for example, are installed here. Actions in this folder are available to all user accounts on your Mac. ~/Library/Automator - If you double-click action files you've downloaded or choose File > Import Actions... in Automator, the actions are installed here automatically. These actions are available to you, but not to other users on your Mac. Actions are installed into one of the three /Library/Automator folders Note: To access the Library folder in your home directory, press Option and choose Go > Library from the Finder's menu bar. Workflows Automator's template chooser panel gives you lots of choices when creating workflows Automator allows you to construct workflows in a variety of formats, each of which has its own benefits and use cases. When you build a workflow, you choose the most appropriate format for your needs. Then, when you save the workflow, Automator either asks you to choose an output folder, or it saves it automatically into a specific location based on the workflow's format. Applications Automator workflow applications are just like other apps. You double-click them and they run. When you save a workflow as an application, Automator allows you to choose its location. You can put it anywhere, such as your Applications folder, Documents folder, etc. Once saved, you can even drag it to your Dock for quick access. Workflows A workflow file is a saved Automator document. Double-click it to open it in Automator for editing. Like applications, workflow files can be saved anywhere you wish. Calendar Alarms A Calendar alarm workflow is a specifically configured application, that is intended to be run from a Calendar event's alarm at a scheduled date and time. These types of workflows are saved into the ~/Library/Workflows/Applications/Calendar folder in your home directory. A Calendar Alarm workflow is configured to run from an Open File alarm Automator installs Calendar alarm workflows into your ~/Library/Workflows/Applications/Calendar folder Services Service workflows appear in the Services menu and contextual menus throughout OS X. They're typically used to perform some automated function on selected text, files, images, and more. These types of workflows are saved into the ~/Library/Services folder in your home directory. You can move a saved Service into the /Library/Services folder to make it accessible to all users on your Mac. Service workflows appear in the Services menu and contextual menus throughout OS X Service workflows are saved into the ~/Library/Services folder Service workflows can also be enabled/disabled or be assigned to hot keys in System Preferences, under Keyboard > Keyboard Shortcuts > Services. System Preferences provides a place to manage your service workflows Print Plugins Print plugins appear in the PDF menu of the print dialog throughout OS X. They're used to process printed PDFs. For example, you might create a print plugin that renames a printed PDF and uploads it to your FTP server. These workflows are installed into the ~/Library/PDF Services folder in your home directory. Like Services, you can move print plugins into the /Library/PDF Services folder in order for all users of your Mac to access it. Print plugin workflows show up in the print window's PDF menu throughout OS X Print plugin workflows are saved in the ~/Library/PDF Services folder Folder Action Workflows Folder actions are workflows that are attached to folders and configured to run when new files are placed into the folder. Folder actions are saved into the ~/Library/Workflows/Folder Actions/ folder in your home directory. Folder actions can be configured using the Folder Action Setup app, which you can access by Control+Clicking on a folder and choosing Services > Folder Action Setup. You can access Folder Actions Setup via the Finder's contextual menu Folder Action Setup allows you to enable, disable, and edit Folder Action scripts and workflows Image Capture Plugins Image Capture plugins are workflows that appear in the Image Capture app. They can be configured to run to process images as you're downloading them from a camera. For example, you might make an Image Capture plugin that adds copyright metadata to your images, backs them up to an offsite server, and then imports them into iPhoto automatically as they are downloaded. Image Capture plugins are saved into the ~/Library/Workflows/Image Capture folder in your home directory. Image Capture plugins can be set to process your downloaded camera images Script Menu Workflows Finally, although Automator doesn't presently include an option for saving workflows in the OS X script menu, you can place them there yourself. Just save your workflow as a Workflow file or application and move it into the ~/Library/Scripts or /Library/Scripts folder. The script menu offers a nice location for organizing and gaining quick access to scripts and workflows. You can turn on the script menu in the preferences window of AppleScript Editor in /Applications/Utilities. The script menu in OS X also allows you to run Automator workflows You enable the system-wide script menu in AppleScript Editor's preferences window So, now you should have a pretty good handle on where your various Automator workflows reside. If you're still getting started with Automator, this information will no doubt come in handy soon, as you follow along with some of my future posts.

  • Preparing Blog Images with Automator

    by 
    Ben Waldie
    Ben Waldie
    12.03.2012

    Automator's the perfect tool for streamlining some of the repetitive things you do on a daily basis. One thing it's great at is doing basic manipulation to lots of image files. Need to resize a bunch of images or convert them from one format to another? No problem, Automator is ready to help. In this post, you'll build an Automator workflow that prepares images for your blog by renaming them sequentially and then scaling them down in size. Don't have a blog? Well, this workflow could also be used for preparing images for insertion into a Word document, or to send in an email. Feel free to adjust to your specific needs. Building the Workflow Note: If you have any trouble following along, you can download the complete workflow here. 1. Launch Automator (in your Launchpad or /Applications folder) 2. When the workflow template panel appears, select Service and click Choose. By creating a service, you'll be able to run the workflow on selected files in the Finder. Creating an Automator Service workflow 3. At the top of the workflow (on the right side of Automator's window), set the Service to receive image files in the Finder. By setting this, the Finder uses its contextual knowledge to only let you run the workflow when you have image files selected. Setting the workflow to process images in the Finder 4. Search for the New Folder action and add it to the workflow. Enter Scaled for Web into the Name field and leave it set to create the folder on the Desktop. Note that this action has some hidden functionality. First, it knows not to create the folder if one already exists. Second, it receives the selected image files as input when the workflow runs, and it copies them into the newly created folder. This ensures that any manipulations are done later to duplicates, and your original images remain unharmed. The New Folder action copies your selected images in the Finder into a Scaled for Web folder on the Desktop 5. Find and add the Get Folder Contents action to the workflow. This action retrieves any files in the Scaled for Web folder. The Get Folder Contents action gets the duplicated image files for processing 6. When Automator processes files, it doesn't always do so in the order you expect. This can be a problem if you want to rename files sequentially. To solve the problem, you'll tell the workflow to sort them. Locate the Sort Finder Items action and drag it to the workflow area. Configure the action to sort the files by name in ascending order. The Sort Finder Items action makes sure your images are renamed in the proper order 7. Search for the Rename Finder Items action and drag it to the workflow. Automator warns you that this action changes the names of files, and suggests inserting a Copy Finder Items action too, in order to preserve the original names. The first step in your workflow already copies the original images. So, there's no need to copy them a second time. Click Don't Add to tell Automator not to insert the additional Copy Finder Items action. Automator often warns you when files are modified and suggests working with copies From the popup menu in the upper left corner of the action, choose Make Sequential (note that the name of the action in your workflow changes to Make Sequential). Set the action to add a number to a new name and enter a dash, followed by the desired name. Configure the other settings to place the number after the name, to separate by a dash, to start numbers at 1, and to make all numbers 2 digits long. Configure the Rename Finder Items action to sequentially name your images 8. Next, you'll tell Automator to add the date to the beginning of each image's name. Since the Rename Finder Items action doesn't include this option, you'll use a variable. Click Variables at the top of the action library and locate the Today's date variable. Automator variables let you insert values that are calculated at runtime into your workflows Drag the Today's date variable to the beginning of the new name field in the Rename Finder Items action. By default, this variable is set to the format M/D/YYYY. The Finder, however, doesn't like slash characters in file names. So, you'll configure the variable to use dashes instead, and to be formatted in YYYY-MM-DD format for better sorting. Click the triangle button on the right side of the variable and choose Edit... The date variable is editable Choose Custom format... from the format menu in the Variable Options window that appears. Custom formatting allows you to specify a precise format for a date variable Drag year, month, and day components together into the editing field and separate them with dashes. Click the triangle to the right of the month and day components, and set them to appear as two digits. Click Done when you're finished. Formatting the Today's date variable as YYYY-MM-DD 9. Find the Scale Images action and drag it to the end of the workflow. Again, Automator warns you about modifying your images. And, again, since your workflow is already working with duplicates, you should be safe. Click Don't Add so the Copy Finder Items action isn't inserted too. Automator really, really, really wants to protect your files. If you get annoyed by these alerts, click the checkbox to prevent future ones from appearing. Configure the Scale Images action to resize your images To Size (pixels) and enter the desired pixel size. Note that this is on the longest side of the image. The Scale Images action resizes your blog images 10. Save the workflow as Blog - Scale Images. Automator installs it where it needs to go. Saving the workflow as a Service makes it accessible in the Finder Running the Workflow In the Finder, select a bunch of images and right click to display the contextual menu. Choose Services > Blog - Scale Images to run the workflow. Your workflow appears in the Finder's contextual menu when you have image files selected The workflow runs, creates a Scaled for Web folder on your Desktop, copies the images into the folder, renames them sequentially, and scales them the appropriate amount. The renamed and scaled images are copied into a Scaled for Web folder on your Desktop Now, with the help of your new Automator service, you can get back to writing, and spend less time editing images. Happy blogging!

  • Build a photo calendar with Automator

    by 
    Ben Waldie
    Ben Waldie
    11.13.2012

    You've seen it in your Launchpad. You've seen it in your Applications folder. It's Automator. It sounds cool. It looks cool. It's got a cool robot icon. But, what can it really do, and why should you care about it? Well, Automator can do lots of things to improve and streamline your OS X experience. With Automator, you use building blocks called actions like ingredients in a recipe. When your actions are strung together, the result is an Automator workflow that can perform a series of tasks. Apple provides lots of built-in actions for automating things with Calendar, Mail, Safari, and more. You get even more actions as you install Automator-ready apps, like Aperture, BBEdit, Microsoft Office, and Transmit. What you can do with Automator depends on the actions installed on your Mac. So, you may run into limitations if you don't have actions for certain tasks, or if an app doesn't support Automator. For simple things like working with folders, images, and PDFs, however, it's a great tool that can save you time and let you do some fun stuff. In this post, I'll show you how to use Automator to create a print plugin that shows up in the PDF menu when you print a document. This specific plugin lets you print a photo calendar right out of the Calendar app.

  • Dear Aunt TUAW: Can I turn off Messages logging?

    by 
    Michael Rose
    Michael Rose
    03.23.2012

    Dear Aunt TUAW, Ever since I started using Messages, it appears to be logging everything it does. Can this be disabled, or can the log file be moved to somewhere out of the ~/Documents folder? Your darling nephew Tommy Dear Tommy, Auntie's tending to the spring turnover of the vegetable garden, so she asked Uncle Mike to chime in on this question. The beta of Messages, like its predecessor iChat, has a feature that automatically saves chat transcripts (including transferred files or images, which can get out of control pretty quickly if you're not minding it). Unlike iChat's setting, however, in Messages there's no way to turn the logging off. Be sure to let Apple know that you'd like to see this changed before Mountain Lion ships! With regard to the second half of your question, the answer is absolutely yes; you can go into Messages' preferences, click the Messages icon in the top bar, and then adjust the "Save chat transcripts to:" folder however you like. Since you can't disable the logs, the next best thing would be a way to clear them out periodically -- once an hour, once a day, once a week, whatever. There are scores of approaches to scheduling repeating tasks on your Mac, ranging from the UNIX-savvy one-liners (cron, launchd etc.) to capable and flexible commercial applications (Auntie's terribly fond of Noodlesoft's Hazel). For something like this, though, if you want to clear out the logs once a week, you might give OS X's built-in Automator utility a try. Automator lets you set up a workflow to run when triggered by an iCal event, so it's straightforward to set up a repeating "silent reminder" that simply goes into the logs folder, grabs what's there and tosses it into the Trash. Here's what the workflow would look like: Each step in the workflow passes its results along to the next step, letting us zero in on what we actually want to throw out. This workflow starts by identifying a specific folder (in this case, the iChats log folder), then getting the contents of that folder, and finally moving those items to the Trash. When you save an iCal alarm workflow, it gets dropped right into your calendar. You can then adjust the repeating schedule to make it run at whatever frequency you like. The log files will end up neatly in the Trash; no muss, no fuss... which is more than Uncle Mike can say for Auntie's rows of sugar snap peas. This same technique can be used for any folder that tends to accumulate things you don't actually need to keep. Toodles, UM

  • Mac 101: Encode media from Automator or the command line in Lion

    by 
    Kelly Hodgkins
    Kelly Hodgkins
    11.22.2011

    There's an easy way in OS X 10.7 Lion to convert video or audio from one format to another, using a fixed suite of conversion settings. One approach uses Automator and can be launched from the Finder. The other uses the Terminal application and the afconvert (for audio) or avconvert (for video) command-line utilities. Behind the scenes, though, Automator is simply serving as a convenient front-end for the CLI tools. (You can also use the free Hoot app from the Mac App Store to do the same audio conversions.) The Automator method is the easiest to start with. Simply select the video or audio file you want to convert in the Finder. Under the Finder menu, choose the Services submenu, then "Encode Selected Video Files" or "Encode Selected Audio Files." You can also get to the Services submenu via the Finder's contextual menus; right-click the target file (or control-click, or on a trackpad, two-finger click) and the Services choices will be at the bottom of the pop-up menu. Finder menu / Services submenu Contextual pop-up menu Either approach will launch a dialog box where you can select your media conversion settings and the target file's destination. You can process one file at a time or, if you select multiple files, they'll be tackled in a batch conversion. The settings are slightly different for audio and video files, as appropriate to their media types -- you can experiment with the different settings to find the format that works for you. Video encoding settings Audio encoding settings For those of you more comfortable with the command line, you can use afconvert to encode an audio file from one format to another or avconvert to do the same with video. Type "afconvert -h" in Terminal to get a list of all the options you can use in the audio conversion. The avconvert tool is new in OS X Lion. Besides transcoding, it also lets you extract the audio or video track from a clip, change frame rates, add closed captioning and more. You read more about Automator video encoding and audio encoding at the Mac OS X Automation website. Additional information on the CLI commands can be found in Apple's Mac OS X Developer Library.

  • DimScreen simply dims your screen

    by 
    TJ Luoma
    TJ Luoma
    09.19.2011

    Once upon a time, I had an application which would dim the screen of my Mac down to 0, and then exit. Somewhere along the way I seem to have lost the app and can no longer find it. Yes, I know I could just hold F1 and do the same thing manually, but I liked having an app that just did it for me. So I did what any self-respecting geek would do: I wrote a shell script. Others did the heavy lifting Let me be clear that my little shell script wrapped in Automator was only a tiny piece of this puzzle. First I'm going to tell you who did all the heavy lifting, and then you can decide how you want to put the pieces together for yourself. (I highly recommend reading to the end before you do anything.) Nicholas Riley wrote a C program called brightness which I found via Matt "Danger" West's website, which I found via Google. Matt includes the source code on his page, or you can download the original 'brightness.c' here and then you can compile it (according to Matt's instructions) using this line: gcc -std=c99 -o brightness brightness.c -framework IOKit -framework ApplicationServices Of course that assumes that you have Xcode installed. If you don't, you can either download and install Xcode (warning: it's 3 GB to download and I think it's somewhere between 7-10 GB when installed). If all of that seems like a lot of hassle, Matt also made a pre-compiled binary available for you to download. Here's what I did I wrote a shell script (dimscreen.zsh) which looks for brightness at $HOME/bin/brightness. If it does not find it there, it will attempt to download it "automagically" from my personal website and then install it to $HOME/bin/brightness. Once brightness is installed, it will dim the screen to 0 and then launch your screensaver. Why does it launch your screensaver? Because otherwise when you went to use your Mac, you might have forgotten that you set the brightness to 0. If you move the mouse or type, you won't see anything. However if the screensaver is on, one of two things will happen: If you have enabled the preference which requires a password to be entered after your screensaver is turned on, you will see that prompt. (Mac OS X is smart enough to automatically turn the screen brightness up a little for you to see that you need to enter your password.) If you do not require a password to be entered after your screensaver is turned on, my script will turn the brightness up as little as possible after the screensaver exits. That should keep you from getting blinded if you are working at night. Then you can adjust the brightness to whatever level you want. I took dimscreen.zsh and made it into an app ("Dim Screen.app") using Automator. I put dimscreen.zsh and the 'Dim Screen.app' and the 'brightness' command (and the source code) all into one nice neat package and put it on my Dropbox as DimScreen. "How do I use this?" 1) If you are the trusting type (or just impatient), download DimScreen, double click it to 'unarchive' it, and then move the 'Dim Screen.app' to /Applications/ (or wherever you keep your apps) and run it. The first time you run it, make sure that you are online so that it can download the brightness utility. (It will only do that once.) 2) If you are trusting to a point but don't want the app to download anything automatically, make a directory called 'bin' in your home directory (that's the one which has the 'Desktop' and 'Documents' and 'Downloads' directories in it). Then double-click the DimScreen.tar.bz2 file, and move the 'brightness' file to the ~/bin directryory you just created. 3) If you pride yourself on your distrust, then by all means, download the source code from the links provided above, compile the 'brightness' command on your own, and move it to ~/bin/ (where ~ is your Home directory). (If you are someone who likes the Terminal.app, you might want to put the dimscreen.zsh script into your $PATH as well, so you can launch it from the command line.) Once you have it installed, launch it via whatever app launcher you prefer. If you want to make it a "one click launch" you might consider Apptivate, a handy little launcher I reviewed previously. There are other ways to do it, of course, but Apptivate is still my preferred "I want to press this key (or "this key sequence") to run this Application/Script/etc" solution. P.S. Yes, I know about Control + Shift + Eject I am sure that some Mac keyboard aficionado will not have been able to wait until the end of the article, and is already writing a comment to tell me that if I press Control + Shift + Eject, then the Mac's screen will turn off. I know. The problem is, I never remember if it's Control or Command, and do I have to hold down the fn key or not. Plus it's really not the same thing, I don't just want it off, I want it dimmed all the way down. I still wanted an (even) easier way. I'm used to triggering all sorts of actions via LaunchBar and wanted to be able to dim my screen that way too. When I read on Apple Stack Exchange about someone who couldn't get that keyboard shortcut to work, I went looking for that old app (mentioned at the beginning of this article) and when I couldn't find it, I decided to just roll my own. Are there other ways of doing this? You bet. If you have a preferred solution, feel free to let us know in the comments.

  • Ask TUAW Video Edition: PDF and Scripting

    by 
    Justin Esgar
    Justin Esgar
    03.29.2011

    Andrew asked us about how to have a folder convert documents to PDF format so that he can sync them to his Dropbox. Today's show goes into how to use Automator and AppleScript to do some scripting, and we're going to demonstrate an iPad app that will convert documents for you on your iPad. Some resources for you: Automator - Mac OS X Automation Automator AppleScript - Mac OS X Automation AppleScript Save2PDF - Main Company Page Any questions, please leave them in the comments or email us! Read on for the video.

  • Fixing broken iTunes Automator workflows in iTunes 10

    by 
    Michael Rose
    Michael Rose
    09.03.2010

    If you depend on Automator workflows for managing music or other tasks in iTunes, the upgrade to version 10 may have come as a bit of a cold shock. Macworld pointed out that most available workflows for iTunes simply would not load with iTunes 10; a frustrating circumstance, to be sure. Fortunately, the problem turns out not to be that complicated; Automator's version checking thinks that iTunes 10.0 is a lower version than 9.0, because the versions are sorting alphabetically instead of numerically (oof!). Macfixit points to a workaround: opening up the Info.plist files inside the packages for the dysfunctional workflows and manually changing the version threshold. It's not ideal, but if you have critical Automator functionality that would otherwise keep you on iTunes 9, it's worth a try.