Poco Script FAQ - Why should I learn scripting?

Poco Script FAQ - Why should I learn scripting?

Q: Can someone give me a few examples of the utility of scripting? Now, understand I'm not a programmer but I'm a relatively sophisticated user.

So that said, what I'm wondering is if there's any reason for me to invest the time to learn scripting. If I knew it, what would I do with it?

 
A: Austin wrote:
I think you have the question backwards: what do you want to do? The Poco scripting language takes about 30 minutes to learn (it's that simple). With it, I've written a mail-FTP script, an early version of the filtering that's now present and standard in Poco (the first versions of Poco didn't have filters built in; I wrote a script that did so and Slaven liked it so much that he took similar ideas and put it in the program itself so it was fast). I've scripted stuff that will make sure that I'm replying from the proper account when I'm replying to a work address.

So the real question is: what need do you have? If it involves filtering, your first step is to try the filters. If it involves manipulating messages or custom filtering learn PocoScript.

Michael wrote:
The possibilities are almost only limited by your imagination. I'll give examples of broad classes of things you can do (and this list is far from complete in itself).

A script can look at any fields in an incoming message and make decisions as to what to do with that message, and it can do multiple things. For example at work we are assigned projects. These projects have 8 character codes associated with them. The codes are in the form 2 alpha characters followed by 6 numeric. I wrote a script that searches the subject line of all incoming and outgoing messages and it the first word (after stripping off things like "Fwd:" and "Re:") is in the form of a project code then the message is automatically routed to it's folder. If the folder doesn't exist it is created.

A script can also process orders from websites and compose reply messages. These messages can be sent or displayed for the end user to amend as necessary. Such a script could even parse the information from the message and update a database with it.

You could use a script to manipulate address books, adding entries, removing them, managing groups, etc. You could even write a script to display information for the person who sent you a message. For example if you wanted to phone them and had recorded their phone number in the Poco address book a script could find their entry, extract and display the phone number.

Scripts aren't limited to working on messages either, there is the FilterSearch script I wrote. People were finding it very difficult to locate filters they had created so I wrote a script that searches the filter definitions and displays the filters that match criteria the user specifies.

Scripts can augment the filtering capabilities of Poco. Poco 2.5 included a large number of new actions but I needed a couple of additional ones, for example marking a message as read. It was simple to do that in a scirpt. (PS: On this topic I've given Slaven some ideas for increasing the usefulness of scripts within filters, we may see this in Poco 3).

There may be other features you would like to see that aren't implemented in Poco. Perhaps they weren't asked for, perhaps demand wasn't high enough, what ever. I needed the ability to annotate messages under Poco 2.1 so I wrote a script to do that. Slaven took the idea and implemented it in Poco 2.5 (we discussed the method beforehand and so the annotations that were entered using the script work with the new annotation capabilities of Poco 2.5). I also needed the ability to display only those messages that had annotations, again a script came to the rescue.

Scripts can actually correct bugs in Poco or in other mailers. For example the beta version currently in test has a bug where html messages are not getting the proper header information to identify them as such. Austin wrote a script to correct this. Unfortunately this isn't working for some people but that's due to a poco limitation not the script.

As well, some time ago there was a bug in HotMail where top posted replies would be inserted before the tag and as such would be invisible. It would have been possible to write a script to pull the reply back into the proper position in the message.

I hope this gives you an idea that scripting is a very powerful tool that is well worth learning.