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

Re: [MacPerl] calling xcmds/xcfns



It seems that MacPerl cannot deal with PowerPC xcmd's.

Fortunately the author of the LAA xcmd, Matsumoto Satoshi, has 
written a scriptable faceless background application "JLAA" that 
accomplishes the same hiragana<->kanji conversions.  You can call it 
in the following way from MacPerl.


     while (<>) {
         print LAAConvert($_, 'toHiragana');
     }

     sub LAAConvert {
         my ($in, $convType) = @_;
         $in =~ s/(?=[\\"])/\\/g;
         my $out = MacPerl::DoAppleScript(qq{
             tell app "JLAA" to LAAConvert "$in" convType $convType
         });
         chop $out;
         $out =~ s/^"|\\(?=[\\"])//g;
         $out;
     }


or, with Mac::Glue installed:


     use Mac::Glue ':glue';
     my $jlaa = new Mac::Glue 'JLAA';
     while (<>) {
         print $jlaa->laaconvert( $_, convtype => enum tohiragana );
     }


JLAA is freeware, available for download at http://www.matsumoto.co.jp .

Gero Herrmann
Nishinomiya, Japan

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