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

Re: [MacPerl] Plug-ins / Applets



At 11.14 97/4/24, Raymond Lauzzana wrote:
>The problem is that the output will be routed to a fresh
>window rather than back to your Browser. Since the output is 'html', this
>is quite the solution.

You can send any URL (including a local file) to a Netscape window (and
probably IE, too) with AppleEvents.

Try this on for size (make sure Netscape is open first):

#!perl
use Mac::AppleEvents;
($dir = $INC[0]) =~ s/lib$/$1/;
$temp = $dir . time;

open(TEMP,">$temp") || die "can't create file: $!\n";
select TEMP;
print <<EOT;
<HTML><HEAD><TITLE>Test</TITLE></HEAD>
<BODY BGCOLOR="CCCCFF">
<H1>Hi there ...</H1>
</BODY></HTML>
EOT
close(TEMP);

$be = AEBuildAppleEvent('WWW!','OURL',typeApplSignature,'MOSS',0,0,'') or
die $^E;
AEPutParamDesc($be,'----',(AEBuild('TEXT(@)',"file:///$temp")));
AESend($be, kAEWaitReply) or die $^E;

unlink $temp;

sleep(15);

AEPutParamDesc($be,'----',(AEBuild('TEXT(@)',"http://pudge.net/"))); # ;-)
AESend($be, kAEWaitReply) or die $^E;

__END__

#================================================================
Chris Nandor                                      pudge@pobox.com
PGP Key 1024/B76E72AD                           http://pudge.net/
Keyfingerprint = 08 24 09 0B CE 73 CA 10  1F F7 7F 13 81 80 B6 B6



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