Mac Productivity: Quick Scripts and Workflows – Archiving Selected Mail Messages

Keeping up with email often seems like a losing battle. One thing that can help is reducing the number of messages in your inbox. Filing messages into individual mailboxes can be time consuming and inefficient. While dumping them all into a single mailbox may seem like a way to create a big mess, Mail’s search capabilities actually make it quite easy to locate specific messages.

Taking a lesson from Gmail’s All Mail feature, Mail in Lion includes a new option for archiving messages. Just select a message, choose Message > Archive from the menu bar, and the message is moved into an Archive mailbox, which Mail will create if it doesn’t exist. This feature gives Mail users a quick and easy way to file messages, getting them out of that bloated inbox.

I’d love to use Mail’s built-in Archive feature. However, it only archives to the mail server (for IMAP accounts, anyway, which is what I have). I keep my email archive locally. So, I used a combination of AppleScript and Automator to create my own Archive feature. Here’s how... [Read more on the Peachpit blog...]

Adobe InDesign Automator Actions Released in the Mac App Store

I'm pleased to announce that my ID Automator Action Pack, which includes 20 actions for interacting with Adobe InDesign in Mac OS X Lion and Snow Leopard, has been released in the Mac App Store. It can be found here.

Information about my other Lion action packs can be found here.

-Ben

Text Automator Action Pack Updated to 4.0.3 – Includes 2 New Actions

The Text Automator Action Pack has been updated to version 4.0.3. Changes include:

  • Added a new 'Add Prefix to Text' action
  • Added a new 'Add Suffix to Text' action

This action pack extends the power of Automator with 30 actions for performing text manipulation functions in Mac OS X.

The new version is available in the Mac App Store.

Maccast Podcast 2012.02.26 – Automator Basics

I recently spoke with Adam Christianson about Automator in Mac OS X for the Maccast.  Topics included getting started with Automator, building a simple workflow, and troubleshooting workflow problems.  Check it out on the Maccast website or in iTunes!

File and Folder Automator Action Pack Updated to 4.0.1

The File and Folder Automator Action Pack, which includes 21 actions for interacting with files and folders in the Finder, has been updated to version 4.0.1. Changes include:

  • Fixed a bug in Filter Finder Items by Size action
  • Fixed a bug in Unlock Finder Items action

The new version is available in the Mac App Store.

AppleScripts for Marking Messages as Read in Mac Mail

At the request of MacSparky, I've put together a few AppleScripts for Mac Mail users, to mark messages as read...

Script 1: Mail • Mark All Inbox Messages Read

tell application "Mail"
     set read status of every message of inbox to true
end tell

Script 2: Mail • Mark All Messages Read

display alert "Please note!" message "This script may take a while if you have a ton of mailboxes. Do you want to continue?" buttons {"Cancel", "Yes"} cancel button "Cancel"

with timeout of  600 seconds
     tell application "Mail"
          set read status of every message of inbox where its read status = false to true
          set read status of every message of every ¬
               mailbox where its read status = false to true
          set read status of every message of every mailbox ¬
               of every account where its read status = false to true
     end tell
end timeout

Script 3: Mail • Mark Selected Mailbox Messages Read

display alert "Please note!" message "This script may take a while if you have a lot of mailboxes selected. Do you want to continue?" buttons {"Cancel", "Yes"} cancel button "Cancel"

set processSubMailboxes to (button returned of (display alert "Would you like to scan all submailboxes too?" message "Again, if you have a lot of selected mailboxes and submailboxes, this may take a while." buttons {"Yes", "No"})) = "Yes"

tell application "Mail"
     tell front message viewer
          set theSelectedMailboxes to selected mailboxes
          repeat with a from 1 to length of theSelectedMailboxes
               set theCurrentMailbox to item a of theSelectedMailboxes
               processMailbox(theCurrentMailbox, processSubMailboxes) of me
          end repeat
     end tell
end tell

on processMailbox(theMailbox, processSubMailboxes)
     tell application "Mail"
          if processSubMailboxes = true then
               set theSubMailboxes to every mailbox of theMailbox
               repeat with a from 1 to length of theSubMailboxes
                    set theCurrentSubMailbox to item a of theSubMailboxes
                    processMailbox(theCurrentSubMailbox, processSubMailboxes) of me
               end repeat
          end if
          set read status of every message of theMailbox to true
     end tell
end processMailbox

Usage

You can download these scripts here.

You can quickly and easily run them from the system-wide AppleScript menu.  This menu is not enabled by default.  To enable it and install the scripts...

  1. Launch AppleScript Editor in /Applications/Utilities
  2. Select AppleScript Editor > Preferences from the menu bar
  3. Under General, click the Show Script Menu in the Menu Bar checkbox
  4. Bring Mail to the front
  5. From the script menu, choose Open Scripts Folder > Open Mail Scripts Folder
  6. Copy the scripts into the folder.  They will now be available from the script menu when you're working in Mail

Enjoy!

-Ben

What not to do in Mac Mail

Here's a handy data loss prevention tip.  With a Mail message selected, do not press either of the secret undocumented keyboard shortcuts Option+Control+H or  Command+Option+Control+H.  That is, unless you want your selected message irretrievably deleted.  Not moved to the trash.  Deleted.  Permanently.

Tested in Mac OS X 10.7.3. Bug report filed.

Note: If you're backing your Mac up with Time Machine, as you should be, then you may be able to restore the vaporized message.

10 Mac OS X Productivity Tips for Open and Save Dialogs

They're open and save dialogs. You navigate to a file or folder. You select it.  You enter a file name when saving.  You click Open or Save.  How much more efficient can you get? Well, here are 10 things most Mac users probably don't know...

Tip 1: Drag and drop a file or a folder right from the Finder into the open or save dialog to quickly select it.  If you do this in a save dialog with a file, then the file's name is automatically entered as the save name.

Tip 2: With a folder or file selected in the dialog, press Command+R to bring the Finder to the front and reveal the item.

Tip 3: To manually navigate to a folder, press Command+Shift+G (or / or ~).  Enter the desired path.  As you type it in, you can press tab to auto-complete folder names.

Tip 4: To see hidden files and folders, press Command+Shift+Period (>).

Tip 5: To quickly navigate to:

  • The Desktop - Press Command+D
  • The Documents Folder - Press Command+Shift+O
  • The Downloads Folder - Press Command+Shift+L
  • The Applications Folder- Press Command+Shift+A
  • The Home Folder - Press Command+Shift+H

Hint: The other navigation keyboard shortcuts in the Finder's Go menu should work here too.

Tip 6: To create a new folder, press Command+Shift+N.

Tip 7: To navigate up one level, press Command+Shift+Up Arrow Key

Tip 8: To choose an image, audio track, or movie, click Media in the sidebar.

Tip 9: To move a file or folder displayed in an open or save dialog to another folder, open the target folder in the Finder.  Then, drag the item from the open or save dialog into the opened folder window in the Finder.

Tip 10: With a file or folder selected, press Command+I to bring the Finder to the front and display the Get Info window for the item.

So, there you have it. Small tips that will save you a few precious seconds here and there and make you more productive.  Every second counts, right?

Macworld | iWorld 2012 Favorite Find: olloclip

More and more, my iPhone is becoming my camera of choice.  It takes great photos, and I always have it with me.  This year, at Macworld | iWorld, I was excited to stumble upon the olloclip.  It's a 3-in-1 lens that fits snuggly over your existing iPhone lens.  Included lenses are fisheye, wide-angle, and macro.  I have to say, I love this lens, and highly recommend it for anyone who wants to do more with iPhone photography.  It'll set you back about $70, but it's such a great little accessory, to me, it's well worth the price.

For anyone considering it, here are some observations…

  • The olloclip is tiny.  It will easily fit in your pocket.
  • It only works with the main iPhone camera (the one on the back of the phone), not the one that faces you.
  • You access the macro lens by unscrewing the wide-angle lens.  To use the macro lens, you need to get in very close, within about 1/2".
  • The fisheye lens has an extensive range, so you'll need to grip your iPhone more on the sides if you want to prevent your fingers from being visible along the edges of the photos.
  • The olloclip is a tight squeeze.  You'll have to remove your phone from its case to use it.  And, if you have a screen protector, it may push it out of the way if you aren't careful.
  •  The olloclip is designed for the iPhone 4/4S.  If Apple releases a new form factor iPhone 5, you'll probably need to purchase a new olloclip, assuming they release an updated version.
  • The olloclip comes with a small microfiber bag, which doubles as a lens cleaner.

In short, I concur with Stephen Hackett's Three-Word Review of the olloclip… Buy it now!

-Ben

olloclip Gallery:

Now Available: New Mac Automation Made Simple Videos!

Peachpit has bundled a new series of my Mac Automation Made Simple videos on Automator.  They're now available for purchase as DRM-Free downloads, so you can play them on your Mac, iPhone, or iPad.  Topics in this 8-part series include:

  • Automate generating job folders - If you use job folders for multiple projects to keep organized, learn how to save time and reduce errors by building workflows in Automator to create job folders consistently and quickly. You'll also learn the basics of actions and variables in Automator.
  • Batch-create folders from an Excel list - If your workflow ever requires you to create a large number of folders or sets of subfolders with specific naming conventions, Excel and Automator can work together to eliminate the manual creation of folders. By using the powerful features in Excel to build lists of file names in large numbers and use Automator to process those lists into hundreds of folders in minutes.
  • Display Growl notifications for new content - File sharing over a network is great for larger files that you wouldn't send via email, but how can you be sure that you're always notified when a new file lands in your folder? Learn how to team Automator with the popular notification software Growl to build a great workflow that eliminates the need for you to get an email or phone call notifying you of new files.
  • Schedule backups via a network - Do you manually back up your Mac to a server? If so, you've probably had to set up calendar reminders and run through the process on a regular basis or risk losing your data. In this lesson, learn how to make that process automatic and painless with Automator and iCal.
  • Share files via Dropbox - Take the powerful PDF tools offered in OS X a step further by building your own Print Plugin with Automator. You'll learn how to set up a Print Plugin that automatically posts any document you print to PDF to the online file sharing tool Dropbox. You'll also learn the basics of setting up actions to rename files to be friendly for upload tools by removing offending characters.
  • Batch-convert image files to PDF - If you've ever had the daunting task of scanning a book or a box of images with a flat bed scanner, you know that it isn't easy to combine all those files into a single PDF without some heavy-hitting applications like Photoshop and Acrobat Pro. But what if you don't have those applications or are just looking for an easier way? Learn how to set up a quick and easy way to combine multiple images into a single PDF without the hassle.
  • Batch-process images for iPhoto - If you're like most people with a smart phone, an amature photographer or have a large photo digitizing project on your plate, you'll import, manipulate and save hundreds to thousands of images a year. In this lesson, you'll learn how to unleash the power of Automator and free third-party tool to streamline your workflow and make importing images to your iPhoto library a snap.
  • Batch-process multiple InDesign files to PDF - Exporting multiple InDesign files to PDF can be as quick and easy as dragging and dropping your files. You'll learn how to create a drag-and-drop application with AppleScript and Automator that opens, exports, names, and saves PDFs from InDesign. You'll be able to use the same custom application for both InDesign CS4 and CS5.

Sold as a set, or individually, you can find them on Peachpit's website.