[Forum Request] AppleScript Display?

Just a curiosity question…

Toby (aka “marketforceit”) responded to a post of mine…

http://bbs.applescript.net/viewtopic.php?id=18099
(you have to scroll down a bit)

…and his was colorized similar to the way Script Editor or ScriptDebugger would. I found it alot easier to read and “follow along” without having to copy it locally and compile it.

My first thought was “Wow Toby, how’d you do that? I want to do that!” but then I realized it bypassed the “click to load snippet” feature. Not that copy-n-paste from the screen bothers me, but I figured it would annoy the heck out of “old timers” here. Last thing I want to do is alienate the “big guns” here…I need their help. :wink:

I bumped into one other AppleScript site whose display engine for AppleScript was similar to how Toby’s displayed. I believe they also had a utility to “webize” AppleScript, but I couldn’t get it to work for forum posts since it wrote an entire web page includes CCS styles (yuck).

So the question I was wondering, probably aimed at the Admins, is there a reason this forum doesn’t (or maybe can’t) “pretty” the script display a bit?

I know, I know, kinda nit-picky, and likely be asked a zillions times (or maybe not at all, and I’m just too visually oriented…)…

–Kevin

No offense Kevin, but I cleaned up that post. :slight_smile:

For those unfamiliar with it, Kevin is talking about the default output of Jon’s app: Convert Script to Markup Code

First, a request: Please don’t use Jon’s app here. The extra BBCode takes up more space in our database, and the appearances can not be easily changed across the whole forum (like you’re asking for).

Offhand, I can say that any coloring depends on our parser properly parsing the script; This is inherently difficult because our web server doesn’t compile AppleScript itself.

Hey Kevin,

Bruce pointed out this post to me, so I thought I would jump in. :rolleyes:

I guess first off, we are constantly trying to improve MacScripter {which obviously includes this forum}. What Bruce says is correct though: there is a lot more to simply rendering the script code to make it pretty; we have to ensure what goes in comes out the way we want it to, and that is often times the challenge. Also, we have to be very careful that it doesn’t use up system resources. There would be nothing worse than having a hawg.

We have looked at a really nice parser, which suposedly gets rid of a few gotchas that our parser currently suffers from. It also presents the code in a really nice way, and is customizable {ie: colors, etc}.

I’m scared to death though, as it will require a total rewrite of our current system. Without more significant testing, I don’t want to jump out of the frying pan into the fire: translated, introducing more issues than we had originally. Right now, our parser will churn through just about everything you throw at it and render correctly. And, do it fast.

That said, everyone seems pleased with the color choices we’re currently using. However if there are other members who want to see change, let us know. There are some minor tweeks we can make to colorizing the script code.

In the meantime, I’ll look into seeing what we can do about the new parser. :wink:

BTW: Please, do not use Jon’s appescript parser! {Jon, we love you! :D} – for literally years we used {everyone} used Jon’s script - it was because of applescript.net he wrote it! However, as we grew and the board got better, we built in the parser so it renders the code natively. Using his script will make it a lot harder to keep things updated and the backend clean.

HTH

Yeah I figured it might be a pain or hard and that’s why it hadn’t been done…figured it didn’t hurt to ask.

And, like I mentioned, I wasn’t planning on using anything other than the built-in forum parser, don’t worry. I know the headaches of trying to pre-empt an existing parser. :wink:

Thanks for taking the idea in the spirit it was offered. :smiley:

Just as a matter of interest, though, how is the parser and linker done now?

We aim to please. :smiley:

Matter of fact, I’m visiting about this very thing right now.

Thank You, Thank You, Thank You.

We loved Jon’s script when it was useful: and to be sure it was. But now, quite frankly it’s a pain. It took us a very long time to clean up the board: it puts in a load of code you don’t need, and the system has to parse. Moreover, had to ween folks off using it because they either didn’t realize how our new parser worked, or just didn’t know how to read. :mad:

No, Thank You for understanding. We’re working very hard to make this a better place. Please have patience. :slight_smile:

Adam, I would imagine that it’s a (heavy) modification of the existing BBCode parser. It likely looks for certain words or characters and applies visual styling based off that; Catching exceptions to these typical “rules” are where most of the issues (and my resulting e-mails ;)) come from.

Pfft, you don’t need my patience. This forum is alot better than other forums I use on a daily basis for personal stuff, and leaps ahead of many (most?) “business” forums I have to use. You have my awe and kudos if ya want them though. :wink:

My question was almost a nitpick by that standard, and I know it. :smiley:

But it’s good to know it’s been thought about. I know everyone’s idea of “pretty print” is different. I just personally have a hard time scanning black-and-black pages with bold being the only real differentiator. Guess all the greens and blues and greys spoil me.

I can recall from doing HTML 1.0 work (ugh, dating myself?) when I first got ahold of a copy of BBEdit. I almost fainted…auto color-coding and tab nesting? “Pretty” code automatically? God’s gift to coding that was. :wink:

It’s never been an issue to me, really. If I’m even vaguely interested, I routinely click on the link to see it ‘pretty printed’ in Script Debugger 4. If I remain interested, I save it, if not I trash it.

If you looked at Craig Smith’s recent tutorial on launchd, you would see that it contains a plist file embedded in applescript bbCode tags. I could not find any other way of showing it without the plist tags being interpreted or damaged. Saved my buns.

I couldn’t help but respond … :stuck_out_tongue:

Yes, at the time we ‘rebuilt’ the forum, I had the Applescript parser written custom.

In fact, one of the very reasons I started MacDeveloper was because of this very project: at the time, the developer was on Windows. Since he didn’t have a Mac in his hip pocket, in order for him to intelligently implemment and test I ended up giving him VNC access to a machine in my office. {I’m happy to say btw he has since seen the light}

While I’m sure there are today, at the time there weren’t any parsers written, or “out of the box” solutions for Applescript. There were a kazillion for php, ruby, python and the like, but nothing for Applescript was available.

Given the complexity and the English like syntax, I think we did a pretty decent job, all things considered. :rolleyes:

{… Bruce, I hate you} :lol:

Ray, I wonder why. :smiley:

LOL! :wink: