cs150bf / ever-notedown

Atom Editor Plugin
MIT License
140 stars 13 forks source link

import note from evernote failed #5

Open simpzan opened 9 years ago

simpzan commented 9 years ago

evernote: 6.0.14 atom: 1.0 ever notedown: 0.2.4

cs150bf commented 9 years ago

@simpzan Unfortunately I will need more information to know what had gone wrong. Stack trace? Or maybe at least a brief description of the steps leading to the error.

simpzan commented 9 years ago

I just install ever-notedown, then invoke import note from evernote command. input a keyword on the dialog to search note in evernote, then select one note from a list of note result. it supposed to open the note in atom editor, but nothing happened next. the following is the log i get from command line, cause i started atom editor from command line.

[87150:0702/143554:INFO:CONSOLE(1371)] "Error: Command failed: /bin/sh -c osascript /var/folders/wj/d11l_89502z9cfl5744jtt4r0000gp/T/evernote-retrive-note-temp11562-87152-1vxriqb.AppleScript
/var/folders/wj/d11l_89502z9cfl5744jtt4r0000gp/T/evernote-retrive-note-temp11562-87152-1vxriqb.AppleScript:197:293: execution error: Evernote got an error: The operation couldn’t be completed. Operation not permitted (1)
", source: /Users/simpzan/.atom/packages/ever-notedown/lib/evernote-helper.coffee (1371)
cs150bf commented 9 years ago

@simpzan Could you go into your ENVD repo (defaults to ~/.atom/evnd/), find the script tmp/evernote-retrieve_note.AppleScript, and see what the content is? It should look something like this:

tell application "Evernote"
    set note1 to find note "evernote:///view/<SOME STRING REPRESENTING THE NOTE LINK>"
    if note1 is not missing value then
        export [note1] to "<PATH TO YOUR EVND REPO>/20150702/<NOTE FILE NAME>.enex" format ENEX
        export [note1] to "<PATH TO YOUR EVND REPO>/20150702/<NOTE FILE NAME>.html" format HTML
    end if
end tell

(If you want, you could try running this script with the OSX script editor, or run osascript evernote-retrieve-note.AppleScript in command line.)

I suspect it is because the path or the file name contains some special characters and it somehow fails to execute. If I know roughly what kind of characters is causing the problem, I might be able to try to sanitize the string a little bit more.

simpzan commented 9 years ago
tell application "Evernote"
    set note1 to find note "evernote:///view/171694647/s3/b8e2b198-b7cd-4724-ae87-a35d12a76352/b8e2b198-b7cd-4724-ae87-a35d12a76352/"
    if note1 is not missing value then
        export [note1] to "/Users/simpzan/百度云同步盘/notes/20140219/code_complete_evernote.enex" format ENEX
        export [note1] to "/Users/simpzan/百度云同步盘/notes/20140219/code_complete_evernote.html" format HTML
    end if
end tell

here is the content of the file. when I run the script in script editor, an error dialog showing following msg:

Evernote got an error: The operation couldn’t be completed. Operation not permitted
cs150bf commented 9 years ago

@simpzan Ouch, we might have a problem here... So I cannot reproduce the error, and I have ruled out a few possibilities (file path issue, directory permission issue, etc.). But Google returns some results indicating that some people are seeing this Operation not permitted error while others don't (!!!). There might be a bug with the EN client...

Are you using the EN client from the mac app store? If so, my best guess for now is try re-installing it with the dmg downloaded directly from the official website. If by any chance that solves this problem, then maybe we should file a bug report to the Evernote team.

Edit: This seems to confirm my suspicion that this error has to do with the app store version of EN client.

Reference:

  1. https://discussion.evernote.com/topic/79715-backup-of-evernote/
  2. https://github.com/jamietr1/evernote-backup/issues/1
  3. http://www.jamierubin.net/2014/08/12/going-paperless-how-and-why-ive-automated-backups-of-my-evernote-data/
  4. https://github.com/jamietr1/evernote-backup/blob/master/README.md
simpzan commented 9 years ago

yes, my EN client is from mac app store. I will test dmg version later today.

On Fri, Jul 3, 2015 at 11:16 AM, Hong Chen notifications@github.com wrote:

@simpzan https://github.com/simpzan Ouch, we might have a problem here... So I cannot reproduce the error, and I have ruled out a few possibilities (file path issue, directory permission issue, etc.). But Google returns some results indicating that some people are seeing this Operation not permitted error while others don't (!!!). There might be a bug with the EN client... Are you using the EN client from the mac app store? If so, my best guess for now is try re-installing it with the dmg downloaded directly from the official website https://evernote.com/download/. If by any chance that solves this problem, then maybe we should file a bug report to the Evernote team.

Reference:

  1. https://discussion.evernote.com/topic/79715-backup-of-evernote/
  2. jamietr1/evernote-backup#1 https://github.com/jamietr1/evernote-backup/issues/1
  3. http://www.jamierubin.net/2014/08/12/going-paperless-how-and-why-ive-automated-backups-of-my-evernote-data/

— Reply to this email directly or view it on GitHub https://github.com/cs150bf/ever-notedown/issues/5#issuecomment-118221171 .

simpzan commented 9 years ago

it's true. the dmg version works ok.

On Fri, Jul 3, 2015 at 11:20 AM, simpzan simpzan@gmail.com wrote:

yes, my EN client is from mac app store. I will test dmg version later today.

On Fri, Jul 3, 2015 at 11:16 AM, Hong Chen notifications@github.com wrote:

@simpzan https://github.com/simpzan Ouch, we might have a problem here... So I cannot reproduce the error, and I have ruled out a few possibilities (file path issue, directory permission issue, etc.). But Google returns some results indicating that some people are seeing this Operation not permitted error while others don't (!!!). There might be a bug with the EN client... Are you using the EN client from the mac app store? If so, my best guess for now is try re-installing it with the dmg downloaded directly from the official website https://evernote.com/download/. If by any chance that solves this problem, then maybe we should file a bug report to the Evernote team.

Reference:

  1. https://discussion.evernote.com/topic/79715-backup-of-evernote/
  2. jamietr1/evernote-backup#1 https://github.com/jamietr1/evernote-backup/issues/1
  3. http://www.jamierubin.net/2014/08/12/going-paperless-how-and-why-ive-automated-backups-of-my-evernote-data/

— Reply to this email directly or view it on GitHub https://github.com/cs150bf/ever-notedown/issues/5#issuecomment-118221171 .

stygiansabyss commented 8 years ago

Sorry to come back to this late, but it seems like the dmg version is doing it as well now. Every time I try to save a note, Evernote crashes. Same error as detailed by OP. Tried your solution to grab the dmg version (even went crazy on removing everything from the app store version), same issue.

Error: Command failed: /bin/sh -c osascript /var/folders/ll/hv3nyv892f76htybprh61rww0000gn/T/evernote-create-note-temp116029-8327-wbaz0t.AppleScript
/var/folders/ll/hv3nyv892f76htybprh61rww0000gn/T/evernote-create-note-temp116029-8327-wbaz0t.AppleScript:341:434: execution error: Evernote got an error: Connection is invalid. (-609)

    at ChildProcess.exithandler (child_process.js:215:12)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:817:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)(anonymous function) @ /Users/stygian/.atom/packages/ever-notedown/lib/evernote-helper.coffee:691