Created
April 25, 2012 12:30
-
-
Save tjsnell/2489411 to your computer and use it in GitHub Desktop.
Paperless
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
-- stage the files so we can keep scanning | |
tell application "Finder" | |
set theFolder to folder "Lion:Users:tjs:Downloads:toProcess:" | |
set targetFolder to folder "Lion:Users:tjs:Downloads:processing:" | |
move entire contents of theFolder to targetFolder | |
end tell | |
-- Use Acrobat Pro to OCR and optimize. This saves to the folder 'processed' | |
tell application "System Events" | |
tell application process "Acrobat" | |
tell application "Adobe Acrobat Pro" to activate | |
click the menu item "OCR This" of menu 1 of menu item "Action Wizard" of the menu "File" of menu bar 1 | |
repeat until exists (window "Action: OCR This") | |
end repeat | |
click button "Next" of window "Action: OCR This" | |
repeat until exists (window "OCR This") | |
end repeat | |
click button "Close" of window "OCR This" | |
end tell | |
end tell | |
-- Take all the processed scans and stuff them into ths Evernote inbox | |
tell application "Finder" | |
set myfiles to every file of folder "Lion:Users:tjs:Downloads:processed:" | |
repeat with eachfile in myfiles | |
tell application "Evernote" | |
create note from file eachfile as alias title name of eachfile tags "inbox" notebook "inbox" | |
-- attachments {eachfile as alias} | |
end tell | |
delete eachfile as alias | |
set targetFolder to folder "Lion:Users:tjs:Downloads:processing:" | |
delete entire contents of targetFolder | |
end repeat | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment