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

Re: [MacPerl] Translate AppleScript to Mac::Glue



At 20.47 +0200 2000.04.29, René Laterveer wrote:
>    if class of the front window is message window then
>        set messageRef to displayed message of the front window
>    else

Well, you can try:

  $front_window = $outlook->obj(window => 1);  # or whatever
  $class = $outlook->get( $outlook->prop(class => $front_window) );
  my $wanted_class = 'message_window';

  if ($class eq $outlook->{NAMES}{$wanted_class}{id}) {
    $messageRef = $outlook->get(
      $outlook->prop(displayed_message => $front_window);
    );

  } else {
    # ...

  }

I suppose it would be MUCH better to provide an accessor so you can get the
id of a class, though.  Actually, it would be better, I think, if a
returned class were turned into its class name.  Hm.  In any event, this
code above will work for now, I think, but I cannot approve of it for the
long term, because I cannot guarantee the object data structure underneath
will remain the same forever.



>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.

I don't know how Outlook Express mail rules work, I don't know.  What is
giving the timeout error message?  MacPerl, AppleScript, Outlook Express?

-- 
Chris Nandor       |     pudge@pobox.com      |     http://pudge.net/
Andover.Net        | chris.nandor@andover.net | http://slashcode.com/

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