Your samples should work fine on the Mac, too, if embedded in a browser
page, but not as stand-alone OSA scripts.
I'm new to JSOSA, but I think I can say why that code doesn't work: Any
JavaScript verbal (written or printed) interaction with the user is not
really part of the JavaScript core, so you have to rethink input and output
in terms of the Apple OSA environment (as opposed to the browser
environment), using the input, output, and printing commands available from
the Finder and AS Additions, all of which have their JSOSA equivalents.
I'm told that a browser-style library, providing things like window.print(),
alert() and prompt() to JSOSA, might be available through this list, but I
can't find any mention of such a thing in the archives. If you're really
ambitious, you could write your own set of JS functions that accept Netscape
or Explorer commands and invoke the appropriate OSA routines, but it might
be easier to just use the MacOS object and its methods instead.
After all, JSOSA is designed to allow you to script the Finder, not to
develop JS functions for the Web (although I think it has great potential
there). Remember, tho, I did say I'm a newbie (so take what I say with big
chunk of sodium chloride)...
On 10/22/02 10:27 AM, "jsosa@yahoogroups.com" <jsosa@yahoogroups.com> wrote:
> Message: 1
> Date: Mon, 21 Oct 2002 19:24:01 -0000
> From: "Fluffy and Taquito" <numexicouple@...>
> Subject: Javascript Print
>
> Hi,
> To anyone out there who might have knowledge about making a
> Javascript print function work. I've found two pieces of code that
> works great in windows:
--
Scott Heath, Instructional Designer
Transfusion Medicine Computer Assisted Learning Unit
Bonfils Blood Center, Research Department