Created
August 14, 2014 23:06
-
-
Save WillsonSmith/6ff4e70a7832bda9994e to your computer and use it in GitHub Desktop.
Move screenshots from whatever directory you are currently in into a temp folder. (ie, "cd ~/desktop" "ruby ScreenShot.rb")
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fileutils' | |
files = Dir.glob "*.png" | |
files = files.map { |file| [file.count("?/"), file] } | |
files = files.sort.map { |file| file[1] } | |
files.each do |file| | |
rena = file.include? 'Screen Shot' | |
dchk = 'temp' | |
if rena | |
puts rena | |
Dir.mkdir(dchk) unless File.exists?(dchk) | |
FileUtils.mv(file, 'temp/') | |
else | |
puts "nope" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment