//======================================================================== // // 9.1.09 "filestripper" Joe Mariglio // (www.joemariglio.com) //----------------------------------------------------------------------- // for making the transition between OSX // and Ubuntu SC implementations a bit smoother. //----------------------------------------------------------------------- // make sure there is a directory called "stripped" // where you can put your stripped files. // change the variable 'dir' to your source directory. // if shit goes down, envir variable 'p' hooks into pipe. // //======================================================================== ( var dir, pipe, line; dir = "/home/joe/Documents/SC_Work/Toolbox/arboretum/live_sesh_0"; p = pipe = Pipe.new("ls"+dir, "r"); line = pipe.getLine; while({line.notNil}, { if(line.contains(".rtf"), {var input, path, output, content; input = File(dir++"/"++line, "r"); (dir++"/"++line).postln; content = input.readAllStringRTF; input.close; line = line.replace(".rtf", ""); line = line.tr($\ , $_); line = line.tr($., $-); output = File("/home/joe/Documents/SC_Work/stripped/"++line, "w"); output.write(content); output.close; }); line = pipe.getLine; }); pipe.close; ) p.close