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

Re: [MacPerl] Suggestion for a MacPerl Extension



Andrew McDermott wrote:
> 
> > From neeri@iis.ee.ethz.ch Thu Jul 11 17:43 BST 1996
> > From: Gaspard Gendreau <Gaspard.Gendreau@esrin.esa.it>
> >
> > In other words, I would like to do the following:
> >
> > - drop some text (or a file) onto the droplet
> > - this text (or the content of the file, if I drop a file) would be
> >   the input of my droplet, as if received from an HTTP server
> > - the output of my script would be sent directly to my Web browser
> >
> 
> I beleive netscape has "remote control" extensions which would allow you
> to do this, not only from Macs, but also Windoze and Unix too! (Caveat -
> different for windows, macs and Unix) I once wrote a perlscript which
> would read some newsgroups with respect to my .newsrc file and then
> send an http document to netscape with URLs for the next item in each
> newsgroup. My next step ws to do this for the Mac, but I was told
> "this is not the way to do it".
> 
> Check out Netscape's help pages - I'm sure you'll have something written
> in no time.

Thanks. I looked the doc, but found nothing really straightforward to do
what I am looking for, excepted maybe the shareware Flypaper
(http://www.pass.wayne.edu/~eric/flypaper/) that calls AppleScripts
directly from Netscape.

So to start, I tried to build the simple script below, but had a problem
with passing the environment; how shall I exactly pass the environment
string?
If I pass
      QUERY_STRING=paul
my Perl script (which contains $query = $ENV{"QUERY_STRING"}) returns
      paul=
in $query, i.e. with the "=", and at the right side of the value! If I
put a space (QUERY_STRING paul) nothing is found.

What shall I put as separator between the environment name and its
value? Am I doing something wrong, or is there a bug in MacPerl
AppleScript interface?

I use MacPerl 5.0.7r1m and AppleScript 1.1. (Syst. 7.5.3)

Thank-you.

Here is my AppleScript:


property myPerlScript : "myHD:myPath:myScript.pl"
property myQueryString : "Paul"
property myResultFile : ((path to trash) as text) & "PerlResult.html"

tell application "MacPerl"
        Close Window "MacPerl" -- to clean it 
        Do Script file myPerlScript environment "QUERY_STRING=" & myQueryString
        Save Window "MacPerl" in file myResultFile
end tell

tell application "Netscape Navigatorú 3.0b5"
        ShowFile file myResultFile
        --      activate
end tell


Gaspard

___________________________________________________
Gaspard Gendreau, ESA-ESRIN ID/MM
via Galileo Galilei, 00044 Frascati, Italy
Tel. +39 (0)6 - 941 80 439
fax. +39 (0)6 - 941 80 432
Gaspard.Gendreau@esrin.esa.it
___________________________________________________