Skip to content

Instantly share code, notes, and snippets.

@WillsonSmith
Created July 11, 2015 19:43
Show Gist options
  • Save WillsonSmith/8966b2890ee7d84f5888 to your computer and use it in GitHub Desktop.
Save WillsonSmith/8966b2890ee7d84f5888 to your computer and use it in GitHub Desktop.
Small script to move screenshots from your desktop to a "screens" folder (mac)
require "fileutils"
##moves files including "Screen Shot" to a temp folder
PATH = ARGV[0] ? ARGV[0] : Dir.home() + "/desktop"
TEMP_FOLDER = "screens"
Dir.chdir(PATH)
Dir.mkdir(TEMP_FOLDER) unless Dir.exists?("#{PATH}/#{TEMP_FOLDER}")
FileUtils.mv Dir.glob("Screen Shot*.png"), TEMP_FOLDER
puts ["all finished 😊", "bye bye screenshots! 👋", "nice clean desktop! 💻"].sample
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment