Hi, All -
I haven't seen much about writing scripts for PowerMail lately, and last
time I checked the script page was missing from CTM's web site (I did
write to CTM about it). I admittedly have a great deal of difficulty
wrapping my mind around AppleScript, but I have hacked out a few simple
and easy scripts to help my usage. Thought I would share:
Set Label to XXXX
I have a series of these, to set and remove labels from selected
messages. Labels have an internal numerical ID within PowerMail, with 0
being 'none' and the label IDs corresponding to the Command-key numbers
as set in Preferences. I assign the file name for the script to
correspond to how I have the labels set up. In the following example, I
have the third label set to 'Waiting', and the file name is "Set Label
to 'Waiting'".
tell application "PowerMail"
set theMessages to the current messages
repeat with theMsg in theMessages
set label of theMsg to 3
end repeat
end tell
Purge Spam Immediately
The following script purges all messages from the Spam folder
immediately, without moving them to the Trash first.
tell application "PowerMail"
set fldr to spam container
set alertText to "Do you want to delete all spam messages IMMEDIATELY?"
set answer to display dialog alertText buttons {"No", "Delete"} default
button "Delete"
if button returned of answer is "Delete" then
delete messages of fldr
end if
end tell
ClamXav PowerMail Check
Over at the ClamXAV Forum site:
<http://markallan.co.uk/BB/viewforum.php?
f=1&sid=92c023146c7248c3989ca2117ce20540>
...there is a 'sticky' discussion thread for checking email as it
arrives, with some setup instructions and script examples. I was never
able to get a script working reliably in Mail under Tiger, but took some
time to edit the script for use with PowerMail. My post with the script
listing and application notes is on the 6th page into the thread.
Please note that I only adapted an existing script so that it would run
in PowerMail, and take no credit for the rest of the functionality.
As I indicated in my post, it is easy to set up ClamXav Sentry to scan
the Attachments folder for PowerMail and get protection in that way.
However, scanning the mail as it arrives seems to have very little
performance impact (less than Sentry) and has the advantage of scanning
for phishing schemes as well.
There are several options commented in the script for customizing the
'results' of the script to fit a particular user's needs.
Now if I could only find a way to script the PowerMail 'Find' operation
to get an analog of the functionality of 'Smart Folders'...
Anybody else have scripts to share?
- Don
--
Don Zahniser
Powerbook G3 (Pismo), 40GB HD (5200 RPM), 768 MB RAM, Mac OS 10.4.11