I have Evernote installed through the App Store. I upgraded to 3.3.0 this week. Afterwards, I can no longer create notes using Applescripts. I am running ML 10.8 and this was working the other day in ML before upgrading to 3.3.0.
I have the below script running which is fired as a Folder Action and PDFPens the file, adds to Evernote and then deletes the file. The error handling does not go off, so it is like Evernote is accepting the command and returning success. The Alert in the Evernote section is firing and the script is deleting the file, so I know the call to Evernote is happening.
Please note, I am not an Applescript pro, this is a copy/paste/tweak from "Justin Williams, Second Gear". But this was working a few days ago before the 3.3.0 upgrade.
Any help is appreciated.
- Erik
-- OCR This (PDFpen) -- -- Justin Williams, Second Gear -- work: http://secondgearsoftware.com/ -- play: http://carpeaqua.com/ -- -- Credits: -- Based on Acrobat scripts by Joe Kissel (http://www.macworld.com/article/60229/2007/10/nov07geekfactor.html) on adding folder items to this_folder after receiving added_items repeat with anItem from 1 to number of items in added_items set this_item to item anItem of added_items tell application "Finder" if name of this_item is ".DS_Store" then exit repeat end tell try tell application "PDFpen" open this_item as alias tell document 1 ocr repeat while performing ocr delay 1 end repeat delay 1 close with saving end tell end tell on error error_message number error_number display alert "PDFpen Error" message "Error(" & error_number & "): " & error_message as warning end try
set the item_info to info for this_item set the item_path to this_item as text
tell application "Evernote" try display alert "Importing file" create note from file item_path notebook "* Scanner In" on error error_message number error_number
if the error_number is equal to 4 then -- The file being imported is not supported set userCanceled to false try display dialog "Your Evernote account does not support the import of this type of file. Why not consider upgrading?" buttons {"Cancel", "Go Premium"} default button "Cancel" cancel button "Cancel" with icon caution on error number -128 set userCanceled to true end try
-- If the user wishes they can be taken to the Evernote premium upgrade page if userCanceled is false then tell application "Safari" activate open location "https://www.evernote.com/Checkout.action" end tell end if else -- Unspecified failure display alert "Import into Evernote failed" message "Error(" & error_number & "): " & error_message as warning end if end try end tell
try tell application "Finder" delete the this_item end tell on error error_message number error_number display alert "Failed to delete file after adding to Evernote" message "Error(" & error_number & "): " & error_message as warning end try end repeat end adding folder items to
-- Release Notes -- Version 1.0 (January 8, 2009) - Initial Release -- Version 1.1 (July 1, 2009) - Updated for PDFpen 4.1.4's better OCR scripting abilities
Idea
etm117 1
I have Evernote installed through the App Store. I upgraded to 3.3.0 this week. Afterwards, I can no longer create notes using Applescripts. I am running ML 10.8 and this was working the other day in ML before upgrading to 3.3.0.
I have the below script running which is fired as a Folder Action and PDFPens the file, adds to Evernote and then deletes the file. The error handling does not go off, so it is like Evernote is accepting the command and returning success. The Alert in the Evernote section is firing and the script is deleting the file, so I know the call to Evernote is happening.
Please note, I am not an Applescript pro, this is a copy/paste/tweak from "Justin Williams, Second Gear". But this was working a few days ago before the 3.3.0 upgrade.
Any help is appreciated.
- Erik
Link to comment
12 replies to this idea
Recommended Posts
Archived
This topic is now archived and is closed to further replies.