Re: Recommendations for AppleScript Formatting
Re: Recommendations for AppleScript Formatting
- Subject: Re: Recommendations for AppleScript Formatting
- From: Bill Cheeseman <email@hidden>
- Date: Wed, 24 Oct 2001 06:26:30 -0400
on 10/23/01 7:24 PM, Chris Espinosa at email@hidden wrote:
>
I recall a discussion on the list some months back about the preferred
>
"modern" settings for AppleScript Formatting on this list a while back.
>
I've looked in the archives and I can't find the thread. A couple of
>
people have asked me recently about better (i.e. colored) defaults for
>
AppleScript formatting; could those of you who have an opinion about
>
this repost (or send me in private mail) your preferences?
Here's an excerpt from what has appeared for the past three years in the
"Format" sidebar of the "Scripts" chapter of The AppleScript Sourcebook. It
was written with a focus on showing AppleScript formatting effectively on
Web pages. To read the full discussion, go to
<
http://www.applescriptsourcebook.com/scripts.html>, then click the "Format"
button near the top of the page.
"The use of color and style attributes reflects my personal AppleScript
formatting preferences, to help distinguish among comments, variables,
values, application keywords and other special AppleScript terms. These may
not all appear as desired in your browser, but the intent is as follows:
"Operators, etc. (+ & ,) are in plain black text
Language keywords are in underlined black text
Application keywords are in bold underlined black text
Comments are in plain gray text
Values (numbers, strings, lists) are in plain dark blue text
Variables and subroutine names are in bold dark red text
References are in plain dark green text (but you will never see them in a
compiled script)
".... Note that underlining requires HTML version 3 or newer , so not all
browsers will necessarily reproduce this attribute accurately. I believe
[this] formatting is both easier to read and more effective in
distinguishing the important AppleScript syntactical categories. I leave
operators in plain black text because HTML handles that more easilyand they
are easy to identify, anyway. (You probably didn't remember that a space is
an operator in AppleScript, so if you give operators a style, you will find
HTML tags surrounding every space in your compiled script.) All keywords are
now underlined, and emboldened as well if they are application as opposed to
language keywords. Variable names and values are in color so that items
created by the script itself stand out."
When choosing or recommending colors for public consumption, please be
mindful that somewhere between 10% and 20% of males have great difficulty
distinguishing red from green, and perhaps 3% of females have trouble
distinguishing blue from yellow. There is a longish and somewhat humorous
discussion of colorblindness issues in the "Format" sidebar, along with a
couple of citations to some HTML style guides that take colorblindness into
account.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
Croquet Club of Vermont -
http://members.valley.net/croquetvermont