Page 1 of 1

Javascript.....

Posted: Sun Mar 16, 2008 8:03 pm
by ChristopherBodell
Does anyone know how to run javascript from Revolution?

I hava some javascript code i want to use to email with.
Do i just put it into a field and run the command "do fld "Field_JS" as javascript"....

Posted: Mon Mar 17, 2008 1:22 pm
by Janschenkel
Hi Christopher,

Your general idea is correct, you would use the 'do <script> as <language>' construct to execute a script in another language than Revolution.

But first you have to make sure that Javascript is supported on your platform. You can check the global property 'the alternateLanguages':

Code: Select all

answer the alternateLanguages
On MacOSX, you'll get a list of the OSA-compatible languages that were installed - OSA stands for Open Scripting Architecture, and is the underlying mechanism which allows you to automate tasks using AppleScript and other OSA-compatible languages.

On Windows, Revolution 2.9 will add support for the Windows Script Host system - a system similar to OSA, which allows scripters to automate COM-enabled applications and libraries.

On this Windows XP machine, among other languages, such as VBScript, I get "JScript" - which is the Microsoft implemenatation of ECMAScript, the official name for Javascript.

In short, there's no built-in Javascript, but you can use OSA/WSH to execute scripts in alternate languages, provided they are installed.

Hope this helped,

Jan Schenkel.