Script Indenting?

Peter M. Brigham pmbrig at gmail.com
Sat Dec 12 08:19:15 EST 2015


A while back, Mark Wieder posted a snippet of code that I use in my library stack that does this very thing, calling some obscure IDE handlers:

      -- colorize script
      -- thanks to Mark Wieder, of the useRev listserv
      -- how he figured this out, I don't know
      put the number of lines of field "script" into tNum
      -- the following 2 lines are only necessary if no script has been opened yet in this
      --   session of LC
      -- and they will throw an error for later versions of LC
      try
         send "sePrefInit" to stack "revNewScriptEditor"
         send "revSEColorize thisScript,default" to stack "revNewScriptEditor"
      end try
      _internal script colorize line 1 to tNum of field "script"

If this doesn't point you in the right direction, maybe Mark knows more.

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig

On Dec 12, 2015, at 5:37 AM, Scott Rossi wrote:

> Thanks for the pointer.  I want to format script text that lives in a
> standard LC field for easier readability.  The script gets executed by a
> "do script" command.
> 
> Thanks & Regards,
> 
> Scott Rossi
> Creative Director
> Tactile Media, UX/UI Design
> 
> 
> 
> 
> On 12/12/15, 2:32 AM, "use-livecode on behalf of Peter TB Brett"
> <use-livecode-bounces at lists.runrev.com on behalf of
> peter.brett at livecode.com> wrote:
> 
>> On 2015-12-12 11:22, Scott Rossi wrote:
>>> Anyone know where the script/rules for indenting a LiveCode script
>>> resides
>>> in the IDE?
>> 
>> Hi Scott,
>> 
>> The scriptFormat handler might be a good starting point:
>> 
>> https://github.com/livecode/livecode-ide/blob/develop/Toolset/palettes/scr
>> ipt%20editor/behaviors/revseeditorbehavior.livecodescript#L1052
>> 
>> What do you have in mind?
>> 
>>                                    Peter




More information about the use-livecode mailing list