From: Dan Kohn Date: 2005-12-31T20:04:59+09:00 Subject: Re: Directory and file listing In line 4 here, the array is sorted and then the method is called on each element of the array. dir=gets Dir.chdir dir images=Dir["*.jpg"] images.sort.each do |img| material_importer( img) end def material_importer( img) model = Sketchup.active_model materials = model.materials # Adds a material to the "in-use" material pallet. m = materials.add img.to_s begin # Returns nil if not successful, path if successful. Should # return a texture object m.texture= img.to_s + ".jpg" rescue UI.messagebox $!.message end end