Using Processing 2.0 with Notepad++ or SublimeText as external editor

I have used Processing with an external editor for years now, and I relied heavily on the “use external editor” option in the IDE. That option is now gone, and has been replaced by a command line option instead.

At first the removal of that option annoyed me, but it has grown on me after I managed to set it up properly.

To set it up in Notepad++ you have to install a plug-in called NppExec. That can be done with the plugin manager.

When that is done, open up the source file for a Processing sketch, and press F6.

As command enter:

C:\path\to\processing\processing-java.exe --run --force --sketch="$(CURRENT_DIRECTORY)" --output=c:\temp\p5

Just change it to point to the correct path, and for output have some temporary folder set up.

Works like a charm

As I was also tipped about Sublime Text on Twitter after posting this, I decided to try it out.

I sat up a new build system with the following lines:

{
"cmd": ["C:\\path\\to\\processing\\processing-java", "--sketch=$file_path", "--run", "--output=c:\\temp\\p5", "--force"]
}

Which also seems to work very well. As for how that editor is, I guess I will find out.

10 thoughts on “Using Processing 2.0 with Notepad++ or SublimeText as external editor

  1. Alvern

    Thank you. I’m actually using

    –run –force –sketch=”$(CURRENT_DIRECTORY)” –output=”$(CURRENT_DIRECTORY)/ouput”

    so that the output will be in a folder of the Sketch folder.
    But I can’t seem to get any of the println() commands. Is it possible with this way? Or only with the original processing application?

     
    Reply
    1. Greger

      Yeah, I chose to have the output elsewhere, since I usually don’t need to have the output laying about. Having it in a temporary directory made it easier to delete and ignore.

      I do see output from println.
      Under the plugins-menu in Notepad++ go to NppExec and make sure you have a check mark on “Show console dialog”

       
      Reply
  2. Alvern

    I think I forgot to save the file with the println() before run. I can see it now.

     
    Reply
  3. babaorom

    When I use : J:\Processing\processing-2.0b7\processing.exe –run –force –sketch=”C:\Users\YC\Documents\Processing” –output=C:\temp\p5
    with a name’s sketch : truc.pde
    Processing window is opening and the sketch does’nt work
    Could you help me please ?

     
    Reply
    1. Greger

      The name of the folder that the sketch is in, and the name of the sketch file must be the same.
      E.g.

      If filename is test.pde, then it must be in a folder called test.

       
      Reply
  4. mweber

    Thanks for this post, it helps a lot!

    Only problem I’m having with Sublime: can’t see the stack trace in case of a bug. Any help?
    Console dialogs (printLn() out) I do see..

     
    Reply
      1. mweber

        Unfortunately not working for me. The package is, but no stack trace in sight.

        Does it work for you? I.e. if you delete a semicolon somewhere, does it tell you the line number?

         
        Reply
        1. Greger

          I do get error messages like:
          expecting SEMI, found ‘println’
          Letters.pde:83:10:83:10: Syntax error, maybe a missing semicolon?

           
          Reply
          1. mweber

            Ah, right. And 83 is the line number, it is even clickable! And I was wrong, stack traces are turning up as well. Great stuff!

             

Leave a Reply

Your email address will not be published. Required fields are marked *


*