Re: Invisible comments (was: Re: Finder Tell Blocks)
Re: Invisible comments (was: Re: Finder Tell Blocks)
- Subject: Re: Invisible comments (was: Re: Finder Tell Blocks)
- From: Ivan <email@hidden>
- Date: Wed, 06 Mar 2002 12:01:06 -0700
>
Try setting the colour of comments to white in the AppleScript formatting
>
dialogue. It's not perfect, but it does the job.
Here's a somewhat tested script for Smile I wrote last night. Just wanted
to share one of my few good ideas.
--Begin Script
(*A few of my favorite colors*)
property invisible : {65535, 65535, 65535} --White
property custom : {34952, 34952, 34952} --Granite
set foo to AppleScript formatting
set bar to color of comment style of foo
if bar is invisible then
set color of comment style of foo to custom
else
set custom to bar --This is supposed to save any formatting changes made
--outside the script. I don't remember if I tested it.
set color of comment style of foo to invisible
end if
set AppleScript formatting to foo
(* Here I force Smile to recompile the window, thus changing the color of
the comments. Of course you could always just recompile it yourself, and
there is probably an easier way to force the color change. Anyone? *)
try --In case no window is open or it's not a script window
set theWind to window 1
set word 1 of theWind to word 1 of theWind & ""
check syntax of theWind
end try
--End Script
As was mentioned before, a potential problem with this is that all the
comments are still there (just hidden). Thus multiple-line comment blocks
(like the one above) can still get in the way. You can also mess up your
comments if you're not careful. It does help with readability though. An
advantage (I think) is that you can still see the comment indicators -- and
(* *). Thus you know that there are comments, they're just hidden.
One thing that Nisus can do is make text invisible. That completely hides
the text so that it doesn't take up any space. I didn't notice any similar
capabilities in Smile. I have used it simulate outline mode while
programming in C. The code remains plain text for the compiler. It would
be nice if there was an AppleScript plugin for Nisus or something, so that
you could use it to write AppleScripts in Nisus. Or perhaps the same
functionality can be duplicated somehow in Smile. Better yet I should get
Frontier or Radio (as soon as I have $900 to blow on it).
Enjoy,
Ivan Andrus
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.