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

[MacPerl-Forum] Translate AppleScript to Mac::Glue



Hi,

I use the excelent Mac::Glue to drive Outlook Express from MacPerl. It's so
much easier to manipulate text in MacPerl than in AplpeScript....

To genereate a new message I use:

my $outlook = new Mac::Glue 'Outlook_Express';
my $to = "laterveer\@mac.com";
my $bcc = "laterveer\@mac.com";
my $subject = "Dit is een test";
my $content = "Test, en nog een test";
my $account = $outlook->obj(pop_account => 'mac.com account');
$outlook->make(new => "draft_window", with_properties =>
        {subject => $subject,
         content => $content,
         to_recipients => $to,
         bcc_recipients => $bcc,
         account => $account
        });
die $^E if $^E;

This works all very well.

I am trying to translate some AppleScript code to Mac::Glue, so I can do
everything in MacPerl. I have problems with AS code like

----
    if class of the front window is message window then
        set messageRef to displayed message of the front window
    else
----

I have tried experimenting with $oulook->prop, but can't get it to work.
How can I do this in Mac::Glue?

I also have a problem setting my ApplScript/MacPerl script as a Outlook
Express mail rule. The Mac::Glue AppleEvents time out. After the timeout the
message has been constructed.
If I execute the AppleScript (which calls the MacPerl script) directly I
don't get any AE timeout.

_______________________________________________________________________
Rene' Laterveer                              <mailto:laterveer@mac.com>



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