Rev as Linux Shell Script

J. Landman Gay jacque at
Thu Oct 28 16:03:28 EDT 2010

On 10/28/10 2:08 PM, Bill Andersen wrote:

> I've used PHP to do 'shell utilities', I sure wish Rev could act
> similar.  How nice would it be to just have one language/syntax for
> the bulk of your code.

You can insert libURL (or any other script) into the message path so 
that commands to the library will work with your CGI script. It takes a 
little bit of set up.

First, in the View menu in the IDE, choose to show "LiveCode UI Elements 
in lists". Then open the Application Browser and all the IDE stacks will 
appear. Scroll to the "revLibrary" stack in the left-hand list, expand 
it, click on its single card, and in the right side panel find the 
button "revLibURL'. Right-click to edit its script, then copy it.

Paste the script into the stack script of a new mainstack (for this way 
of doing it, it has to be the stack script.) Save the stack as 
"revLibURL" or similar. Upload the stack to your CGI folder on the 
server and set its permissions to 755.

In your CGI script, put this near the beginning after the "on startup" line:

   start using stack "revLibURL"

That will make the libURL script available to your CGI. After that you 
should be able to use libURL handlers as you do in the IDE. (In theory; 
haven't actually tried it. But that's how you create pseudo-includes.)

The libURL library is updated frequently, so you'll have to repeat this 
process every time a new version of LiveCode is released if you want to 
stay current.

Jacqueline Landman Gay         |     jacque at
HyperActive Software           |

More information about the Use-livecode mailing list