Colorize Script
Ken Ray
kray at sonsothunder.com
Thu Apr 15 10:02:47 EDT 2004
Brian,
That currently happens... just right-click (or control-click on the Mac) the
word in question, and it will open up the Transcript Dictionary for that
token.
Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/
> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com
> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of
> Brian Yennie
> Sent: Thursday, April 15, 2004 3:06 AM
> To: How to use Revolution
> Subject: Re: Colorize Script
>
>
> This reminds me of something that I think would be awfully
> useful. What if the below was modified to make keywords
> clickable and take you
> directly to the documentation...? You could type the command name,
> scratching your head trying to remember the syntax, and then
> aww shoot,
> just click on it...
>
> > See 'on colorizescript' in the card script of MC's script editor
> > window...
> >
> > on colorizescript
> > if tokencolors["if"] is empty then setupcolors
> > local s
> > put field "Editor Field" into s
> > put s into field "Editor Field"
> > go to card 2
> > local curword
> > put 1 into curword
> > repeat for each word w in s
> > if tokencolors[w] is not empty
> > then set the textColor of word curword of field "Editor
> Field" of
> > card 1
> > to tokencolors[w]
> > add 1 to curword
> > end repeat
> > local oldline, cline, curline, nwords
> > put min(lineoffset("#", s), lineoffset("--", s)) into oldline
> > put 0 into cline
> > repeat while oldline is not 0
> > add oldline to cline
> > put line cline of s into curline
> > put the number of words in curline into nwords
> > repeat with curword = 1 to nwords
> > if char 1 of word curword of curline is "#" or char 1 to 2 of
> > word
> > curword of curline is "--" then
> > set the textColor of word curword to nwords of line
> cline of
> > field
> > "Editor Field" of card 1 to "DarkOrchid4"
> > exit repeat
> > end if
> > end repeat
> > put min(lineoffset("#", s, cline), lineoffset("--", s,
> cline)) into
> > oldline
> > end repeat
> > go to card 1
> > unlock screen
> > end colorizescript
> >
> > on setupcolors
> > repeat for each word w in the commandNames
> > put "blue" into tokencolors[w]
> > end repeat
> > repeat for each word w in "if then else repeat for with
> while on end
> > switch
> > case getprop setprop"
> > put "Brown" into tokencolors[w]
> > end repeat
> > repeat for each word w in the functionNames
> > put "DarkOrange" into tokencolors[w]
> > end repeat
> > repeat for each word w in the propertyNames
> > put "red" into tokencolors[w]
> > end repeat
> > end setupcolors
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
More information about the use-livecode
mailing list