Load new sketch / .pde

I am writing a tool for presenting a folder full of sketches in a row. Unfortunately i can't find a way to let the editor open a new sketch and play/present it.

Any hints? Or is there another way to load and present a sketch from a .pde? I already played with processing-java console command. But killing processes was not very reliable.

Answers

  • edited June 2014

    Ok. Opening a sketch works like this:

    editor.getBase().handleOpen("mySketch.pde");

    Found it in processing.app Base.java.

  • And now the sketch runs via:

    JavaEditor jeditor = (JavaEditor)base.getActiveEditor();
    jeditor.handleRun();
    jeditor.handlePresent();
    

    Now i just need to open all the sketches, switch through the editors and focus the right Editor.

  • I don't fully understand.

    Do you place this

    editor.getBase().handleOpen("mySketch.pde");

    in the processing IDE and run it as processing sketch?

    Thank you!

    ;-)

  • I put the code in the template code in Eclipse: https://github.com/processing/processing/wiki/Tool-Overview

    But you can run a sketch (via Eclipse) from the tool and control the editor with it.

  • Thanks!

Sign In or Register to comment.