Parsing Livecode script

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
MaxV
Posts: 1574
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Parsing Livecode script

Post by MaxV » Fri May 09, 2014 10:15 am

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 :(
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

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

Re: Parsing Livecode script

Post by BvG » Fri May 09, 2014 1:34 pm

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.
Various teststacks and stuff:
http://bjoernke.com

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

MaxV
Posts: 1574
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Parsing Livecode script

Post by MaxV » Fri May 09, 2014 3:32 pm

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
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”