Execute Javascript?

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Timothy
Posts: 78
Joined: Tue Apr 11, 2006 7:38 pm

Execute Javascript?

Post by Timothy » Fri Apr 14, 2006 5:21 pm

I asked this question at the tail end of a thread that has grown cold. At the risk of being a pest, I'll ask again.

If I have some valid javascript in a RR container, is there a way to make it execute? (I want to use Javascript to interact with a PDF document from within RR.)

Thanks in advance,

Tim
It's better to be happy and rich than poor and sad -- W. C. Fields

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1236
Joined: Sat Apr 08, 2006 1:10 pm
Location: Zurich
Contact:

Post by BvG » Fri Apr 14, 2006 5:41 pm

I don't know how to run it in pdf, sorry, but you might generate a html page, save it and run it in a browser. Basically you need a interpreter for your javascript, and runrev doesn't have one build in.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

Timothy
Posts: 78
Joined: Tue Apr 11, 2006 7:38 pm

Post by Timothy » Fri Apr 14, 2006 9:04 pm

Thanks.

Is there some way to get my Macintosh OS X machine to execute javascript, except from a web browser?

If so, is there a way for RR to launch the javascript interpreter, send javascript to the interpreter, and receive data back from it?

If not, an HTML page might be an interesting workaround. I've never done anything like that. How feasible is it?

Tim
It's better to be happy and rich than poor and sad -- W. C. Fields

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1236
Joined: Sat Apr 08, 2006 1:10 pm
Location: Zurich
Contact:

Post by BvG » Fri Apr 14, 2006 9:28 pm

There is also the JavaScript OSA plugin, I have never used it, but it allows you to run javascript via the (runrev) "do" command (because runrev can execute osa scripts that way).

http://www.latenightsw.com/freeware/Jav ... nload.html
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

revdan
Posts: 21
Joined: Sat Apr 08, 2006 5:59 am

JavaScript OSA Works Well

Post by revdan » Sat Apr 15, 2006 4:01 am

I've never tried using the JavaScript OSA in Rev, but I've used it from Python and Terminal with success and not a lot of hassle. It's been a while but my sense is it works fine.

mcgrath3
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 149
Joined: Thu Feb 23, 2006 8:49 pm
Location: Bethel Park, Pittsbrugh, Pennsylvania USA
Contact:

Post by mcgrath3 » Sun Apr 16, 2006 10:23 pm

Timothy wrote:Thanks.

Is there some way to get my Macintosh OS X machine to execute javascript, except from a web browser?

If so, is there a way for RR to launch the javascript interpreter, send javascript to the interpreter, and receive data back from it?

If not, an HTML page might be an interesting workaround. I've never done anything like that. How feasible is it?

Tim
Tim

put field "myjavascript" into tScript
do tScript as javascript

As long as the Javascript OSA is installed then this should work just fine for you.

Tom
Tom McGrath III
Lazy River Software
3mcgrath@comcast.net

Post Reply

Return to “Talking LiveCode”