Posts Tagged ‘Script’

Run an IMAP Tickler file via a Cron script

Monday, January 23rd, 2006

Zak Greant’s AppleScript for running a Tickler file (a filing system for future actions that is part of the “Getting Things Done” (GTD) system) is very clever.

But it does have one small drawback for some people. Its mailboxes are stored in your Local Folders. If you use more than one Mac to assess a central IMAP store of emails, you will only have your Tickler file on one of the Macs.

One way around this is to run a Tickler file with MailTags. Although due to the way that Mail.app handles IMAP support, a mailbox rebuild will refresh your local cache and wipe out the MailTags info, which is appended to the cached copy of each emlx file.

Ted Pavlic has found another work-around for this which he posted in the comments on the GTD AppleScript post.

He runs a centralised Tickler file on his IMAP server using this script in a cronjob:

#!/bin/sh

# NOTE: The mailutil below has had the maildir patch applied.

# Set things to eastern time zone to keep things in sync
export TZ=EST5EDT

# Get the valid strings
DAY=`date +%d`
WEEK=`echo “($DAY – 1)/7 + 1″|bc`

# On the first day of the month, push monthly notes into inbox
if [ "$DAY" == "01" ]; then
THISMONTH=`date +%m-%b`
/home/tedpavlic/bin/mailutil appenddelete “/home/tedpavlic/.imap/.@TICKLER.Month.$THISMONTH/” “/home/tedpavlic/.imap/.@INBOX/”
fi

# On every day, push dailies
/home/tedpavlic/bin/mailutil appenddelete “/home/tedpavlic/.imap/.@TICKLER.Week$WEEK.$DAY/” “/home/tedpavlic/.imap/.@INBOX/”

Tags: , , , , , , , , ,

AppleScript to enable / disable accounts quickly

Saturday, January 7th, 2006

AppleScriptAutomated Workflows provides an AppleScript that quickly enables or disables Mail.app accounts.

It’s much quicker than hacking through the Accounts pane of Apple Mail’s Preferences. Obviously, the more accounts you have, the more useful the script could be.

Install it by dropping the script into your Mail Script folder (I put mine into ~/Library/Scripts/Applications/Mail).

You can then activate it from the AppleScript menu. The script presents you with a dialog box listing all your mail accounts. Select multiple accounts by holding down the Command key and clicking on the ones you want.

Enable|Disable Accounts is freeware and available from Automated Workflows’ web site.

Tags: , , ,