Friday, 16 April 2010

Terse Code to use file chooser in Ruby Processing

Over on the processing discourse PhiLho the guru posted a short piece of code to get the app user to enter file path data into a sketch in vanilla processing. It can be incredibly terse in ruby:-


load_path = selectInput()# Opens file chooser
# If a file was selected, print path to file else print erro message
puts (load_path)? load_path : "No File Selected"
Update May 2014 this does not work with recent versions of processing (that rely on refelection crap).

No comments:

Post a Comment