Created
February 13, 2013 22:41
-
-
Save tosbourn/4949062 to your computer and use it in GitHub Desktop.
This file contains 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' | |
homepath = File.expand_path "~" | |
desktop_files = Dir.entries homepath + "/Desktop" | |
desktop_files.to_a | |
screen_shot_folder = homepath + "/Desktop/Screenshots" | |
Dir::mkdir(screen_shot_folder) unless File.exists?(screen_shot_folder) | |
desktop_files.each { | |
|the_file| | |
if the_file.include? "Screen Shot" | |
old_file = homepath + "/Desktop/" + the_file | |
new_file = screen_shot_folder + "/" + the_file | |
FileUtils.mv(old_file,new_file, :force => true) | |
end | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment