Skip to content

Instantly share code, notes, and snippets.

@sjl
Created May 11, 2011 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sjl/967369 to your computer and use it in GitHub Desktop.
Save sjl/967369 to your computer and use it in GitHub Desktop.
import sys, os
old_file = sys.argv[1].rsplit('.', 2)[0]
if os.path.exists(old_file):
os.system('osascript -e \'tell app "Finder" '
+ 'to move the POSIX file "'
+ os.path.abspath(old_file) + '" to trash\'')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment