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;
my $app_sign = 'Stリl';
my $params = "'----':obj " .
"{form:prop, want:type(prop),seld:type(sele), " .
"from:obj {form:indx, want:type(cwin), seld:1, from:'null'()}}, " .
"rtyp:type(STXT)";
my $evt = AEBuildAppleEvent('core', 'getd', 'sign', $app_sign, 0, 0,
$params) or die $^E;
my $rep = AESend($evt, kAEWaitReply) or die $^E;
my $str = AEPrint($rep);
AEDisposeDesc $evt;
AEDisposeDesc $rep;
print $str, "\n";
__END__
With this script, I can get StyledText data from Style; and with the
following script:
########
use Mac::AppleEvents;
my $data = 'STXT{ktxt:<<abede...>>, ksty:styl(<<0009000000000010000C...>>)}';
my $app_sign = 'Stリl';
my $params = "kocl:type(docu), &subj:'null'()";
my $evt = AEBuildAppleEvent('core', 'crel', 'sign', $app_sign, 0, 0,
$params) or die $^E;
my $rep = AESend($evt, kAEWaitReply) or die $^E;
$params = "'----':obj " .
"{form:prop, want:type(prop),seld:type(sele), " .
"from:obj {form:indx, want:type(docu), seld:1, from:'null'()}}, " .
"data:" . $data;
$evt = AEBuildAppleEvent('core', 'setd', 'sign', $app_sign, 0, 0, $params)
or die $^E;
$rep = AESend($evt, kAEWaitReply) or die $^E;
my $str = AEPrint($rep);
AEDisposeDesc $evt;
AEDisposeDesc $rep;
__END__
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?
Thank you very much in advance!
Best regards,
Nobumi Iyanaga
Tokyo,
Japan
- Re: [MacPerl] How to script Tex-Edit Plus Nobumi Iyanaga
- Re: [MacPerl] How to script Tex-Edit Plus Jeff Lowrey
- Re: [MacPerl] How to script Tex-Edit Plus Nobumi Iyanaga