Reading from Sockets

rgould8 at rgould8 at
Tue Apr 29 22:15:09 EDT 2008

If I have a webpage that has a link like this:

<a href="">Talk to Rev</a>

and while that webpage in Safari has that link clicked, I'd like to have Revolution lurking in the background waiting for that click, can someone tell me what I'd need to add to this script?

on openCard
? open socket ""
? read from socket "" with message "gotdata"
end openCard

on gotdata
? answer "got data from the Safari webpage!"
? close socket ""
end gotdata

I'm just a little confused about whether I need to _continually_ do the "read socket" in a timer-loop, or if I can give it an infinite timeout.
Right now, I don't get this to work at all, even when I click the link within 5 seconds, so I'm obviously missing something important.? 


-----Original Message-----
From: Bill Marriott <wjm at>
To: use-revolution at
Sent: Tue, 29 Apr 2008 8:33 am
Subject: Re: way to listen to port

You're on the right track.

If what you really need to do is to communicate with Rev from your web page, 
you could set up Revolution as a very simple web server on a *different* 
port -- Safari will use port 80 by default -- and send it a command in the 
form of a URL or POST command. You don't want to have the two applications 
(Safari and Rev) stepping on each other, trying to use the same port.

Andre Garzia's RevOnRockets has a basic web server implementation, but I 
don't know if you'd even need that fully-featured of a solution.

> So, that puts me to Plan B:
> Since this is a touch-screen kiosk environment and I have full-control 
> over the hardware/software, I'd like to just use "SAFT", which is software 
> that makes Safari run in full-screen mode, and then have a silent version 
> of Rev running in the background waiting for it's cue.? When it receives 
> the cue, it needs to print some data to a thermal-label printer attached 
> to the kiosk.
> I am was hoping that I could have a javascript on a web-page that passes 
> data to, and then have my Rev app ready to receive that data.
> I'm not suceeding, however, and I could use some assistance with the 
> scripting.?
> Something like:
> open socket ""
> read from socket "" with message "gotdata"
> and then on the web-page:
> a href="">Click me to test sending a message to Revolution</a>

use-revolution mailing list
use-revolution at
Please visit this url to subscribe, unsubscribe and manage your subscription 


More information about the Use-livecode mailing list