Thread

Index > Scribe > Question re filter scripts
Author/Date Question re filter scripts
Scott
10/04/2009 12:38pm
The documentation for the Script tab of the Filter dialog refers to the ICI plugin. Is this still true? Does this mean that scripts for filters use a different language than the scripts found in the Tools menu?
I thought that support for ICI was being dropped. Is the Script tab still functional? If so, is there any examples of usage anywhere?
fret
10/04/2009 1:34pm
Yes, ICI got dropped a long time ago. I should revise the help.

The current dev build of Scribe v2 uses the same scripting language as the tools menu. I''ve only written one serious script which processes InScribe purchases. This is what that script looks like:

Print("Mail.Subject=''" + Mail.Subject + "''\n");

if (Strstr(Mail.Subject, "Payment received from ") >= 0 ||
    Strstr(Mail.Subject, "Notification of Payment Received") >= 0)
{
    Body = Mail.BodyAsText;
    Start = Strstr(Body, "Buyer:");
    // Print("s=" + Start + "\n");
    if (Start > 0)
    {
        Buyer = Substr(Body, Start + 6);
        End = Strstr(Buyer, "\n");
        // Print("e=" + End + "\n");
        Buyer = Substr(Buyer, 0, End - 1);

        Print("Buyer=''" + Buyer + "''\n");
        
        Key = Execute("c:\\Some Path\\KeyGen.exe", Buyer);
        Key = Tokenize(Key, "\r\n");
        Print("Key=''"+Key[0]+"''\n");
        
        m = CreateThing(0xaaff0001);
        if (m)
        {
            m.Flags = 0x00000044;
            m.To[-1].Email = Mail.From.Email;
            m.From.Email = "fret@memecode.com";
            m.From.Name = "Matthew Allen";
            m.Subject = "PayPal Purchase: InScribe";
            m.Body = "Hi " + Buyer + ",\n" +
                    "\n" +
                    "Thank you for purchasing InScribe for Windows, Mac and Linux.\n" +
                    "\n" +
                    "The key will work for all versions up to but not including 2.00. At any time " +
                    "you may download the latest version of InScribe from the URL above without any " +
                    "further contact from me. There will be a generous discount to upgrade to v2.\n" +
                    "\n" +
                    "When prompted enter the name and key listed here to start using InScribe:\n" +
                    "\n" +
                    "For the name:\n" +
                    "    " + Buyer + "\n" +
                    "Your key is:\n" +
                    "    " + Key[0] + "\n" +
                    "Download the InScribe distribution package from:\n" +
                    "    http://www.memecode.com/inscribe\n" +
                    "\n" +
                    "Beta (unstable) versions will be posted at the same time as i.Scribe versions " +
                    "And will be marked with \"test???\" denoting their unstable nature. The Linux port " +
                    "currently has no stable build.\n" +
                    "\n" +
                    "Please keep this email so that when new versions come out you know where to " +
                    "download them from. The current version is always listed on the website.\n" +
                    "\n" +
                    "enjoy!\n" +
                    "--\n" +
                    "http://www.memecode.com";

            ShowThingWindow(m);
        }
    }
}
Scott
24/04/2009 2:19am
Thanks, that helped a lot.
Reply