Applescript seems to have a global syntax highlighting system which is kinda nifty except that it appears to lack a setting for changing the entire document background. I’ve found that, for me, bright colors on a black background work best.
Xcode, Script Debugger, ASObjc Explorer all offer background coloring but it appears these are application specific. The black background does not appear in Script Editor nor in QuickLook in the Finder. Both show the bright fore colors on a white background which is unreadable. Worse, changing the color scheme in Script Editor changes all the colors except the background color in all the other editors.
This makes it hard to switch between editors, view code in Finder or work in Script Editor.
Some apps support the document color button in the Font panel but Script Editor does not appear to do so.
It looks like Applescript keeps it’s syntax coloring in “~/Library/Preferences/com.apple.applescript.plist” but it does so in an Array instead of dictionary making it impossible to determine what color and font combinations go with what part of the code document.
Anyone know if it is possible to set the background color for Applescript syntax highlighting and how?
Model: Macbook Pro Retina, 15-inch, Late 2013, 10.9.3
AppleScript: 2.3.2
Browser: Safari 537.78.2
Operating System: Mac OS X (10.8)
You may try a setting available in the Accessibility System PrefPane.
In French it’s : Affichage > Inverser les couleurs.
I assume that in English it is something like :
Displays > Revert the colors.
Yvan KOENIG (VALLAURIS, France) vendredi 12 septembre 2014 21:08:42
But: (1) It affects the entire display not just Script Editor. (2) Color inversion uses complementary colors instead of swapping light for dark or vice versa. E.g. if I have light yellow text on a black background in Xcode, in Script Editor it’s yellow text on white background which is largely invisible. The complement of white is black so turning on “invert colors” turns the background black and any black text white. But the complement of yellow is dark purple so turning on “invert colors” changes pale yellow on white background to dark purple on a black background which is equally unreadable.
Still, I’ll certainly tuck your idea away away as a workaround.
I carefully wrote : “You may try” because as I’m not a sooth sayer I can’t guess the your eyes behave.
For my own, old, ones, this mode can’t be used.
But it seems that Apple forget that some users aren’t teenagers.
For instance, the way filenames appear on the Desktop in Yosemite public beta is quite unreadable for my 70 years old eyes.
Maybe I must hope that I will not live too long so that I will not be forced to switch to Windows
Yvan KOENIG (VALLAURIS, France) vendredi 12 septembre 2014 21:39:29
I’m writing most of my scripts in SublimeText which does have a, I guess, the desired syntax coloring for you. You can create build rules and SublimeText so you can build and run code, you can even create projects with multiple AppleScript files. The difference is that you have to use the command line utile osascript as your compiler.
Here a screenshot:
Syntax highlighting is just a personal preference but I use sublime text because of the many languages it supports. So when programming in multiple languages simultaneous and programming for ours I found this color scheme the best for my eyes.
They’re defined in OpenScripting/AppleScript.h, but you can just follow the order in AppleScript Editor’s prefs.
It’s nothing to do with the AS syntax styling – it’s a text view property. You could theoretically set a background to the text, but you’d still have none where there was no text.
I use SublimeText but haven’t tried it for Applescript. I’ll give it shot.
Yep, right there. Didn’t even think to look in the headers and usually that’s the first place I look. Applescript really throws me off for some reason.
Yes, but you can’t tell that from the outside. Some file formats, like rtf, can encode a documents background. I assumed that Applescript didn’t but I was hoping otherwise.
My biggest problem is that when Applescript stores only the light foreground colors, it makes the code unreadable in Quicklook but there doesn’t appear to be any built in solution. I’ll probably bang up a little custom code browser that will support my preferences.
I find that interesting because both myself and others that I’ve spoken to have the opposite reaction. Are you working on a retina display or a pre-retina? Yosemite is optimized for retina so you don’t have a retina display, the new font might not work for you. IRCC, you can switch to the old font in the general system preferences pane. I’ll check when I reboot into Yosemite next.