Programming Projects
You asked for it! (Ok, maybe you didn't)
Thursday, January 23, 2003

I posted the following to the applescript-users list this morning but somehow it doesn't seem to have actually made it to the list (I never received it back) so lemme post it here...

I've been lurking here for a couple months, reading some online docs, puttering around with some things, and I've come up with a Hello World AppleScript project idea that I need some help with. (I'm a 26 year veteran programmer, but AS is a really strange environment, even being a perl monk and a high-end C++ weenie.)

What I want to do is flag incoming emails (in the standard Jaguar Mail app) that belong to a particular category (I already have these emails filtered to a specific folder) and I want the source email address and the datestamp to be saved in some (external?) location. Then I want to test those date times against a similar table of "last date time I sent an email TO that address".

The goal is a rudimentary contact "tickler" that'll say a couple things:

1) "You've received an email from this person, but haven't responded within N days"

2) "You've not sent an email to address X in Y days."

These two are distinct only because "N" and "Y" are different. Otherwise they're fairly similar semantically.

But I'm having a bit of trouble figuring out how to store these two tables. I don't want to rely on nonstandard software components (Otherwise I'd just buy filemaker or something and slam stuff in there.)

So my questions really are:

Is the next best thing really just to blast this all out as a couple text files in some standard ${HOME}/... location and re-parse them every time?

Should I be triggering this script off the filter rules or as an independent script? A rule trigger would work well for #1 above. But I'd want #2 to be run nightly, as through a cron job because it's an awfully big test to be running every time I get an email from someone. I'd very much rather keep them in the same script.

The address list I want to match against needs to come from the address book (but I've had no problem pulling that list.)

One thing that's occurred to me is to fudge text data into the "note" field in the address book entry. It seems hackish, but a "-Last Contacted: MM/DD/YYYY HH:MM:SS" and "-Last Heard From: MM/DD/YYYY HH:MM:SS" line would be programatically accessible and provide a visual indication while going through the address book so that I wouldn't necessarily have to rely on the "alert" (whatever form that would end up taking) triggered by the script.

If I'm missing some basic documentation someplace please feel free to point me to TFM that I may R it.


2:43:44 PM    comment []





© 2003 Michael Wilson
Last Update: 10/26/03; 19:34:45

Click here to visit the Radio UserLand website.

 











January 2003
Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
Jul   Feb

Subscribe to "Programming Projects" in Radio UserLand.
Click to see the XML version of this web page.
Click here to send an email to the editor of this weblog.