learned 1 Posted January 3, 2014 Share Posted January 3, 2014 I've just started playing with applescript in evernote. Granted applescript has it's oddities, but it seems more pronounced in evernote. What I am trying to do is create an applescript which will go through all the notes in my InBox (default notebook) and add tags based on their contents. For example, if the note has the word receipt in it, I'd like to add the receipt tag. Before I pull my hair out I thought I'd see if anyone has written a script like this that they would be willing to share. Link to comment
swbuehler 1 Posted January 27, 2014 Share Posted January 27, 2014 It's actually quite simple in Evernote: tell application "Evernote"set theNotes to every note in notebook "Inbox" whose title contains "Receipt"repeat with eachNote in theNotesassign tag "receipt" to eachNoteend repeatsynchronizeend tell However, the latest version has broken multiple AppleScript items, including the ability to assign tags to notes via AppleScript. Also, the "receipt" tag must already exist; if it doesn't create it. I use a similar method with updating creation dates, assigning and then unassigning a tag so Evernote knows to sync the note. Link to comment
learned 1 Posted March 29, 2014 Author Share Posted March 29, 2014 Am I correct in assuming that the ability to assign tags in EverNote from AppleScript is not yet fixed? I have been trying to write some scripts to do this, and they all fail. Link to comment
jbh 1 Posted January 5, 2015 Share Posted January 5, 2015 9 months later I am also curious about whether or not the ability to assign a tag to selected notes via applescript is supposed to work, as I can't get it to either. I get an error message. Link to comment
jbh 1 Posted February 9, 2015 Share Posted February 9, 2015 I'm not sure if this is the right thread to mention this, but I'm having trouble working with tags at all via applescript. I know Evernote just now resolved an issue with "notebook" in queries, and I was really banging my head against a wall with that one. What am I doing wrong? tell application "Evernote"set selectedNote to selectionset noteTags to tags of selectedNotereturn noteTagsend tell ---> {} I know the currently selected note has tags. I've tried this so many ways, setting class as list, referring to "name of tag" etc, but I get nothing. Is this a bug? Link to comment
Level 5 Adjusting 276 Posted February 9, 2015 Level 5 Share Posted February 9, 2015 selection is a listif you know there’s only going to be 1 note selected, you can just look at item 1, otherwise you can loop through it. Link to comment
jbh 1 Posted February 9, 2015 Share Posted February 9, 2015 Thanks for responding! I'm cool with looping through tags, but I can't get evernote to return any information about tags. if I say "get tags of selectedNote" (and I know the selected note has tags) it returns null. I tried looping and declaring class and a few other things, but I get error or null. If my code is correct, maybe there's a bug? Link to comment
Level 5 Adjusting 276 Posted February 9, 2015 Level 5 Share Posted February 9, 2015 Thanks for responding! I'm cool with looping through tags, but I can't get evernote to return any information about tags. if I say "get tags of selectedNote" (and I know the selected note has tags) it returns null. I tried looping and declaring class and a few other things, but I get error or null. If my code is correct, maybe there's a bug? No, your code is not correct. Like I said, selection is a list, so in the following code set selectedNote to selectionset noteTags to tags of selectedNote you’re setting selectedNote to a list of notes and then asking that list of notes for its tags.That won’t work. A note has tags. A list of notes does not have tags. Link to comment
Level 5* JMichaelTX 4,117 Posted June 11, 2016 Level 5* Share Posted June 11, 2016 It may not be clear from the above posts that assigning tags to Notes is now working in Evernote 6.7.1 (453574) on OSX 10.11.4 tell application "Evernote" set noteList to selection set oNote to item 1 of noteList assign tag "MyTagName" to oNote end tell Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.