Jump to content
  • 0

Applescript "create note" doesn't seem to work


ewokninja

Idea

I recently read an article by Katie Floyd (http://www.macworld.com/article/2029451/how-i-went-paperless-with-hazel-and-evernote.html) which talked about how Hazel was being used to monitor a folder for specific files and, when the criteria were matched, create notes for each of them with specific tags in specific notebooks. Unfortunately when I try this approach it doesn't seem to work. The script is as follows:

tell application "Evernote"	activate	create note from file theFile notebook {"Inbox"} tags {"tag"}end tell

Evernote activates without any trouble but nothing happens after that - I did a little further testing by adding a line after activate to create a new notebook called "test" and this was accomplished without any troubles. I also though I might be doing something wrong with the tags so I tried after having removed the tail end of the line to no avail. I'm not getting any kind of error message, Evernote activates and that's where everything ends: no note, no message, no joy.

 

Are there any known issues here? Am I missing something obvious? Is anyone else having this issue?

Link to comment

8 replies to this idea

Recommended Posts

Hiya,

 

I just joined the forums because i'm having the exact same problem. I've recently changed a lot in my system config (i.e. i upgraded to Mountain Lion, and upgraded Evernote around the same time), so it's hard to isolate exactly what the cause is.

 

I've got a custom applescript (similar to the one posted by the OP) which also handles errors. During a Hazel import, though none of my error handlers are triggered leading me to think everything worked fine, but in fact the new documents aren't in Evernote.

Link to comment

For anyone who reads this in future, I think I might have discovered a bug in the current version of Evernote (5.0.6 400960) whereby the Hazel/AppleScripts won't work unless Evernote is SHUTDOWN. If Evernote is running, the script will not work.

 

Hope that helps.

Link to comment

Hi guys –

 

Having the same problem with uploading files into Evernote automatically. Seems EvernoteHelper (the Elephant in the menu bar) is the problem here...

 

The above script didn't run for me, and I consulted the Hazel log which showed all kinds of errors. When tweaking the script, Evernote was not running, but the EvernoteHelper was, and the script kept changing the application from Evernote to EvernoteHelper when trying to fix it automatically. I decided to quit EvernoteHelper, too.

 

Then, with the help of the Hazel log, I came up with this AppleScript, which works for me. The file ends up in my inbox for further processing. Unfortunately, I'm unable at this point to assign the file to a notebook or add tags.

 

 

 

tell application "Evernote"    activate    create note from file theFileend tell 

 

Let me know if this works for you, too. Remember to quit Evernote and Evernote helper when you're done so Hazel can continue to work in the background. 

 

Hope this is a temporary workaround till smarter people figure out a permanent fix.

 

Greg

P.S. I have Hazel 3.0.16 and Evernote 5.0.7

Link to comment

I don't know if you've found satisfactory answers to this, and this may have been obvious but...  Evernote has to be open for ANY script to work.  It can't seem to find the library unless it's open.

Link to comment
  • Level 5

The problem is that if Evernote is not running, AppleScript sends its messages to EvernoteHelper instead. You can get around this by referring to the application like this:

tell application id "com.evernote.evernote"

I hope this helps.

Link to comment

I recently read an article by Katie Floyd (http://www.macworld.com/article/2029451/how-i-went-paperless-with-hazel-and-evernote.html) which talked about how Hazel was being used to monitor a folder for specific files and, when the criteria were matched, create notes for each of them with specific tags in specific notebooks. Unfortunately when I try this approach it doesn't seem to work. The script is as follows:

tell application "Evernote"	activate	create note from file theFile notebook {"Inbox"} tags {"tag"}end tell

Evernote activates without any trouble but nothing happens after that - I did a little further testing by adding a line after activate to create a new notebook called "test" and this was accomplished without any troubles. I also though I might be doing something wrong with the tags so I tried after having removed the tail end of the line to no avail. I'm not getting any kind of error message, Evernote activates and that's where everything ends: no note, no message, no joy.

 

Are there any known issues here? Am I missing something obvious? Is anyone else having this issue?

 

Applescript confuses "Evernote" with the "EvernoteHelper" app, so you have to be more specific in your tell block.

 

Change tell application "Evernote" to tell application id "com.evernote.Evernote" and it should work fine.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...