Page 1 of 1

Parsing Livecode script

Posted: Fri May 09, 2014 10:15 am
by MaxV
Hi,
I want to share a Livecode script code on a HTML page. I want to highlight syntax using the same colors of the editor, but how can I parse Livecode?
Is there a program that add some tag like <message>, <function> or something to share Livecode snipplet in a nice way?
Is there any parsing program of function?
Or there is an htmlText property of the editor that I could copy?
Unfortunately http://pastebin.com doesn't support Livecode code :(

Re: Parsing Livecode script

Posted: Fri May 09, 2014 1:34 pm
by BvG
If you're not looking to automatically do it via script, this is a way to do it:
  1. Open the script editor
  2. make sure your mouse is over the script editor text field
  3. in the message box execute: "put the htmlText of the mouseControl"
  4. copy paste from message box result
Note that the LC htmlTtext is not exactly standard HTML, it's just similar. there might be further adjustments necessary to make it show a properly formatted script in a webpage.

Re: Parsing Livecode script

Posted: Fri May 09, 2014 3:32 pm
by MaxV
WOW, nice trick!
Now I get the right control with:

Code: Select all

the htmltext of field "Script" of group "Editor" of card "Main" of stack "revNewScriptEditor 1"
this way I don't need to use the mouse!!! :D