Wednesday, June 25, 2008

Impressed with the Automator in Mac Leopard

I have read at many places about how wonderful the Automator program in Leopard is, but never found the need to give it a try and validate its usefulness by myself. Finally, today I got to use it as it turned out to be the solution to my long-standing problem of "how to synchronize emails between Leopard and Boot Camp Vista?".

I use Thunderbird for my email needs and I really like it, especially with the option to add extensions. Now, since I shuttle between Leopard and Vista quite frequently, I wanted to be able to have the same mailbox, content and settings whether I am in Leopard or Vista. Since I use Vista as my main OS for now, my initial solution was to direct the Thunderbird in Mac to use the same profiles folder used by the Thunderbird in Vista. To achieve this, I simply had to do the following:

1. Go to the Thunderbird profiles folder in Leopard: /Users/asif/Library/Thunderbird
2. Change the settings of the profiles.ini file to the following:

[General]
StartWithLastProfile=1

[Profile0]
Name=default
IsRelative=0
Path=/Volumes/Vista/Users/asif/AppData/Roaming/Thunderbird/Profiles/0xxmbl6h.default

3. Changed IsRelative from "1" to "0". Changed the Path from "Profiles/xxxxxxxx.default to that of the Thunderbird installed in Vista (/Volumes/Vista/Users/asif/AppData/Roaming/Thunderbird/Profiles/0xxmbl6h.default)

The only problem with this solution was that everytime I started Thunderbird in Leopard, it took about 5-10 minutes to load all the mailboxes, contents and settings. This happened everytime I loaded Thunderbird, which was quite frustrating. After some time, I could not take this anymore and to solve it, I decided to just copy the profiles folder used by Vista Thunderbird into the Thunderbird directory of Leopard. Thunderbird loading lag was gone after doing so. Now, in order to see the same mailboxes, contents and settings when I go back to Vista, I needed to find a way to automatically synchronize the two folders. I searched in google for such a solution in Mac and came across my saviour, Sync folder 0.9 . This was an action file to be used with Automator and setting it up was a breeze:

1. Click on the "Sync folder 0.9" file to copy it to the automator library
2. Open Automator and create a custom workflow with the following settings



3. Save the workflow as application: file → save as → give a name to the application, select the location to save to and choose the file format “application”.
4. Done! The folders will be synced whenever one double clicks on the application created.
5. Alternatively, one can save the workflow as a plug-in. File→ save as plug-in → give a name to the plug-in and select the application to be used under "plug-in for". In my case, I choose "Finder" at first and then repeated the same thing and choose "scripts menu". Choosing Finder will give me access to the plug-in whenever I right click on the desktop and select the Automator sub-menu under "more"), whereas the "scripts menu" will give me access to the plug-in as a script under the scripts menu which is ever-present (as a scroll icon) on the top-bar of the Leopard Desktop.
6. To delete the applications created (if required), one just needs to go to the path below and delete the respective application:
~/Library/Workflows/Applications/

Thanks to Automator, I am now going to be more on Leopard than Vista as my email problem has been solved. This small adventure with Automator has made me realise the enormous potential that Automator holds and the enormous benefit I can reap from it, by automating the many repetitive tasks that I do daily. To me, Automator is one area where Windows OS falls flat. Maybe there are free third-party tools for Windows that do what Automator can do, but I don't think they are as simple and intuitive to use and may lack a library that is as comprehensive as that of Automator. Features like Automator are things of the future, where repetitive and redundant tasks are automated to allow the human to focus on more important issues. A good lead by Apple, I am definitely impressed!

==update==

Today, I came across two free software to synchronize folders/files in Mac Leopard:

SyncTwoFolders 1.2.5
FileSync 2.0.1

SyncTwoFolders seemed easier to use than FileSync and therefore, I tested it to sync my Thunderbird mail folders between Vista and Leopard (see the snapshot below for the settings), and it seemed to work fine, if not better than the plug-in I created using the Automator because it provided more options on how one wants to sync the two folders. With this, I guess one should use Automator if it provides better functionality than the available free programs.



==update 2==

Today, while reading the Macworld magazine, I came across something related to this post (article "Stay in Sync" by Joe Kissell) and I think it probably explains why sometimes doing sync between my Thunderbird profile in Leopard and Vista Bootcamp does not result in 100% perfect sync. Below is an excerpt from the article that describes the solution to the problem:

"To sync Mail messages, first make sure Mail isn't running on either computer. Using your favourite sync utility, synchronize the entire Mail folder (your user folder/Library/Mail) bidirectionally betwee your two Mac...Then - only after the first time you do this - navigate to that Mail folder in the Finder on each mac and drag the Envelope index file to the trash. Launch Mail and allow it to reimport your messages (which means it's really rebuilding your message database). Quit Mail on one of your Macs. From now on, be sure to run only one copy of Mail at a time. Before switching to the copy running on your other Mac, use your synchronization utility to resync the mail folders..."

Below is how the above might be translated to my situation:

"To sync Thunderbird messages, first make sure Thunderbird isn't running on either Mac Leopard or Bootcamp Vista partition. Using your favourite sync utility, synchronize the entire Thunderbird folder bidirectionally between the partitions...Then - only after the first time you do this - navigate to the Thunderbird folder on each partition and drag all the MSF index file to the trash. Launch Thunderbird and allow it to reimport your messages (which means it's really rebuilding your message database). Quit Thunderbird on one of your partitions. From now on, be sure to run only one copy of Thunderbird at a time. Before switching to the copy running on your other partition, use your synchronization utility to resync the folders first..."

I have not tried this though, but have a feeling that it should work. Will update once i have tested this.

No comments: