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

Re: [MacPerl] Do Script and Send Data commands



Philippe de Rochambeau wrote:
> 
> Does anyone know how to use the 'Do Send' and 'Send Data' commands which
> are listed in MacPerl's dictionary? Could you show me examples?
> 
> Many thanks.
> 

I found that Matthias wrote a explanation in "MacPerl.Frontend" enclosed
in MacPerl514r4.

Here is a exsmple.
---AppleScript
tell application "MacPerl"
        Do Script {"RAMdisk:hello.pl", "param1", "param2", "param3"}
mode Remote
        Send Data "param4" & return
        Send Data "param5" & return
        Quit
end tell
---end of AppleScript

---Perl Script "RAMdisk:hello.pl"
$outFile = "RAMdisk:testOut";
open (OUT, ">$outFile");
print OUT "Hello, World!--direct output\n\n";

foreach (@ARGV){
        print OUT $_, "--argv\n";
}
print OUT "\n";

while (<STDIN>){
        chop;
        print  OUT $_, "--sent data\n";
}
---end of Perl Script

Then, you will get;
---"RAMdisk:testOut"
Hello, World!--direct output

param1--argv
param2--argv
param3--argv

param4--sent data
param5--sent data
---end of "RAMdisk:testOut"

Thanks Matthias!
Thanks Philippe, too, for stimulating question.
Knowing this method, my work is now easier than before.

But, still I don't know how to get the return value (Result) from remote
controlled Perl.
Does anyone know?

Many thanks in advance.

Toshiaki Fujiwara

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch