Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

One of the nice features of BBEdit is that it can show a list of errors (e.g. syntax errors in a Ruby program), and clicking on the error will display the line in the source code file.

How can I bring this window up programmatically, e.g. via the command line, AppleScript, or a language module?

In my specific situation, I'm compiling SML/NJ programs. The compiler lists errors in the following format:

codegen.sml:121.31 Error: syntax error: inserting  LPAREN
codegen.sml:130.49 Error: syntax error: inserting  EQUALOP

When I get compiler errors like that, I'd like BBEdit to display those error messages and let me click on them to display the buggy line in my code.

share|improve this question
up vote 2 down vote accepted

You can do it using AppleScript and BBEdit's results browser command. It isn't well documented, but there are some good examples around to help you out. For example: John Gruber's CSS Syntax Checker.

Here is a sample AppleScript.

tell application "BBEdit"
  set error_list to ¬
    {{result_kind: "Error", result_file: "/path/to/codegen.sml",¬
      result_line: 121, message: "syntax error: inserting  LPAREN"},¬
     {result_kind: "Error", result_file: "/path/to/codegen.sml",¬
      result_line: 130, message: "syntax error: inserting  EQUALOP"}}
  make new results browser with data error_list with properties ¬
end tell

Of course, you will want to create the error_list variable programmatically, but this should get you started. If you change /path/to/codegen.sml to a file that exists on your system, you can see it in action.

share|improve this answer
Thanks for the detailed info! I would never have figured out the arguments from the BBEdit scripting dictionary. I wrote a Python script to filter compiler output and display the browser window. – Jay Lieske Jul 14 '12 at 23:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.