On a recent trip, I found I had failed to add copies of my auto-resizing drop tools to my travel MacBook Air. My droplets allow me to convert images to TUAW-standard sizes, namely 225 pixels for small images and 456 pixels for banner images. (See? Information you never thought you'd need to know.)
What a lot of people don't realize is that OS X offers solutions for these kinds of basic image tasks.
First and foremost is Preview. This app is simply terrific. Yes, I know, Apple took some really helpful utilities like Link Annotation out of the app on its road to Mountain Lion. (Time? Feature trimming? It's hard to say.) Even so, Preview is the best app on your computer that nobody uses enough.
Preview offers a surprising tool suite that combines a little bit of Photoshop and a little bit of Acrobat into one app. In addition to annotating PDFs, you can rotate and crop images using Preview's Tools menu. You have access to lasso selection, color correction, and image fitting, among many other features.
At one point Steve Sande and I threw around the idea of writing an entire book on Preview (there's plenty of interesting material in there!) but ended up deciding against it. Unfortunately, demand leads sales and too few people know how powerful Preview can be.
To resize an image, choose Tools > Adjust Size or click the resizing icon you see at the top-right of this post's main image. The icon looks like an arrowed line in a square box. An Image Dimensions panel slides into view, as you see here.

Select the new width you want to use, making sure the small icon next to the two text fields remains in the locked position. This ensures that the height and width scale proportionately, so the resulting image is sized just right.
Preview isn't the only resizing solution on your Mac, however. The "sips" command line tool offers another take on image processing, one that's especially convenient for scripting and batch processing.
For example, if you want to resize an image to fit a given width, you can ask it to resample to the pixel count you supply. Here's how you might do that.
% sips --resampleWidth 225 input.png --o output.png
You can also perform many of the same tasks as preview. For example, you might rotate an image clockwise by 90 degrees:
% sips -r 90 input.png -o output.png
or convert a file from PNG to JPG format:
% sips -s format jpeg input.png -o output.jpg
OS X also supports related based on "folder actions". These refer to AppleScripts that you attach to folders, so when you drop items into the folders, they run those scripts. It's easy to take a peek at some of the system-supplied actions.
Create a new folder on your desktop. Control-click or Right-click it and choose Services > Folder Action Setup from the contextual pop-up menu. Select a pre-built script like "Duplicate as JPEG" or "Rotate Left" and click Attach. Finish by checking "Enable Folder Actions". Your new folder applies the attached script to any file you drop into it.

If you're an intrepid system-modding type, you can expand these script choices by adding items to ~/Library/Scripts/Folder Action Scripts. (The system supplied versions all appear in /Library/Scripts/Folder Action Scripts).
Scripts are built around a standalone Image Events application, found in /System/Library/CoreServices. This app provides a "faceless background application" that wraps sips for AppleScript scripting. Apple has documented Image Events as part of its developer library, and its docs point to this external website that details how you integrate scripting with image manipulation requests.
I'll leave the rest as an exercise for the reader, but a bit of Googling will turn up already-built image solutions ready for testing.
Here at TUAW, we regularly use these for image resizing -- and they're exactly the bits I forgot to pack on my trip.
So did I get my work done while gone? You bet I did. And a big part of that reason is how sips and Preview enable you to step up to image challenges without any third party software needed.
Got some OS X image processing tips? Share them in the comments.
Preview, sips, and more: OS X image processing tools originally appeared on TUAW - The Unofficial Apple Weblog on Thu, 16 May 2013 14:00:00 EST. Please see our terms for use of feeds.
Apple's Contacts app includes a lot of great shortcuts for initiating different forms of communication. Just click an email address, phone number or URL field label to display a list of available options. You can send an email, show a phone number in large type or start a FaceTime call, for example. Curiously, one shortcut that's absent from most of these popups is one for copying the email address, phone number, URL, etc. to the clipboard. Mailing addresses are one exception, as they provide an option to copy a mailing label. But, other fields don't include this option. Sure, you could just select a phone number, email address, URL, etc., and press Command+C to copy it. But, what fun is that? It sure would be nice if there were just more handy copy-to-clipboard shortcuts instead. With the help of AppleScript, you can add your own. Here's how...







In February, I provided instructions for using AppleScript to send completed task reports from OmniFocus to Evernote. The script was quite well-received by readers, and I've had numerous requests for enhancements. This post provides an updated version of the script, which includes a number of additions. The script now supports full project paths and additional task details including the context, estimated time, start date, modification date, completion date and notes. This additional content is optional, and you can adjust the script to not display it if you wish.


A reader recently wrote to me with a problem. Apparently, Microsoft Outlook no longer contains the ability to create quote level chunks of text when replying to messages in plain text format. Why this functionality was removed, I can't say. But, with a little help from AppleScript and Automator, I was able to help the reader to add this functionality back via a Service. Better yet, the Service can be set up to work in any email client, or even system-wide in any app. Here's how you can do it...







In my last post, I demonstrated how to write an AppleScript that verbally announces when new emails arrive in Mail. Some readers asked whether the same thing could be accomplished with Microsoft Outlook. It certainly can. Here's how...







You're in the kitchen cooking dinner, or sitting down watching TV, or exercising. Ding! You have a new email. Quickly, run to your Mac to see who it's from. Meh, spam. Ding! Meh, a message from your boss. Ding! Meh. Sure would be nice if Mail could announce who's emailing you. That way, you could just listen for ones you care about. Well, with the help of AppleScript and Mail rules, you can set this up on your own. Think of it as an audible caller ID, but for email.






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.





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.







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.







As an OmniFocus for Mac user, it's important that I can quickly create tasks at any time, in any app. OmniFocus makes this pretty easy, by providing integration with OS X Mail, a keyboard shortcut for clipping content in apps such as Safari, a system-wide Quick Entry window and a Services menu item. One feature OmniFocus lacks, however, is direct integration with the Contacts app. Suppose I am in Contacts, for example, and I need to schedule a followup phone call or email to one of my clients? Sure, I could bring up the Quick Entry window and enter the task, but I want something a bit more streamlined. I can accomplish just what I need by writing some custom AppleScripts. The following two examples demonstrate how to write AppleScript-based plug-ins for the Contacts app, which add OmniFocus followup options right into the email and phone number popup menus of your contacts.





I've mentioned before that OmniFocus is my task manager of choice. Each morning, I pull up a list of scheduled tasks for the day, and focus on getting them done. In OmniFocus, I've set up Perspectives (saved window states) for both Due tasks and Completed tasks. What I really want, however, is something that will pull out recently completed tasks and summarize them in Evernote, my note management app of choice. This way, I can maintain a historical log of my progress, and pull out summaries of completed tasks to send to clients. Since this type of integration isn't built into OmniFocus or Evernote, I wrote an AppleScript to do it.





Since Valentine's Day is this week, I thought I would take this opportunity to share an AppleScript I wrote to calculate how long my wife and I have been married. With this baby, I'll never be accused of forgetting how long it's been when our anniversary rolls around. The script determines the elapsed time between now (the current date and time), and a prior date and time (such as our anniversary). It then displays the result in seconds, minutes, hours, days, weeks, months and years.

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.







I'm a big fan of Evernote. I use it for archiving ideas, writing articles / blog posts and lots more. I often insert screenshots and other large images into my notes. Screenshots can be pretty big, and I usually don't want giant images filling up my notes. I keep wishing Evernote offered a way to resize embedded images, so I could insert thumbnails. At the moment, it doesn't. So, I decided to write my own app to resize embedded images. Here's how you can do the same...
TextExpander (Smile Software) is a utility I use each and every day on my Mac to save time and increase productivity. One of the things I use it for is formatting and inserting dates and times -- adding the date or time to a file or folder name, into an email, a document and so on. In this post, I've shared some of my most used date and time snippets. I hope you find them as useful as I do.