At 10:01 PM +0900 3/28/01, Nobumi Iyanaga wrote:
>?Hello,
>
>I am trying to get data from and send data to Tex-Edit Plus using 
>MacPerl's AppleEvents module.
>
>I could write some working scripts for Style:
>
>#######
>use Mac::AppleEvents;
<snip>
>I can open a new document in Style, and set the text of this 
>document to the StyledText data.
>
>As Style and Tex-Edit Plus seem very close as to their scripting 
>support, I thought that changing the "$app_sign" variable to "TBB6", 
>it would be not difficult to get/set data from/to Tex-Edit Plus. 
>But in fact, that does not work...  Does anyone know how to do this?

I would suggest using Mac::Glue instead of Mac::AppleEvents.

This script creates a new window contained the selected text, with styles.
#######
#perl -w
use Mac::Glue;
use strict;

my $glue = Mac::Glue->new('Tex_Edit_Plus');
$glue->activate();
$glue->copy();
$glue->make('new'=>'document');
$glue->paste();
#######

Much nicer, I think...

-Jeff Lowrey

Reply via email to