Instantly share code, notes, and snippets.

Embed
What would you like to do?
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