[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] A script, and a question.



Here's a script I've written to control Macjordomo (this the the ALPHA 
version of 1.5, with AppleEvent support).  As you can see, the code 
spends most of it's time "sleeping" (2hrs and 56min), before calling 
Macjordomo, asking it to connect to every POP account on its list.  While 
Macjordomo is doing that (which should take no more than four minutes), 
the code again sleeps.  Finally, the script has Macjordomo make a copy of 
the main mailing list (as a safety measure I always keep a backup of the 
list handy), and finally, ('cause I need this system for other things) 
tells Macjordomo to quit before going back to sleep for the next cycle.

Aside from the fact that MacPerl needs a way to create a true faceless 
background app, this is pretty nifty.

However...  I'm on a dialup connection (may be changing soon, but 
meanwhile...), and need to log off after this process is complete.  How 
then do I quit my PPP connection when done?

#!perl -w

use Mac::Apps::Launch;
use Mac::Glue;
my $obj = new Mac::Glue 'Macjordomo_1_5fc8';

Hide('MacPerl', 1) or warn $^E;

for (;;) {
    sleep(10560);
    &do_connect;
}

sub do_connect {
    $obj->run();
    $obj->connect();
    sleep(240);
    $obj->export('MycoinfoBrief Users', 'MycoinfoBrief');
    $obj->quit();
}



Brian McNett, Webmaster
*************************************************************
Mycoinfo. The world's first mycology e-journal.
http://www.mycoinfo.com/
*************************************************************


# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org