Skip to content

Instantly share code, notes, and snippets.

@ghickman
Created December 20, 2015 10:11
Show Gist options
  • Save ghickman/decca82fb0e67d7e6e65 to your computer and use it in GitHub Desktop.
Save ghickman/decca82fb0e67d7e6e65 to your computer and use it in GitHub Desktop.
import os
import sys
PENDING = '/Users/george/Scans/Pending OCR'
RM_CMD = r"""osascript -e 'tell app "Finder" to move the POSIX file "{}" to trash'"""
pdf = os.path.basename(sys.argv[1])
root, ext = os.path.splitext(pdf)
path = os.path.join(PENDING, image + '.jpg')
if os.path.exists(path):
os.system(RM_CMD.format(path))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment