Jump to content

Scripting on a Mac (Applescript): Keyword Insert


DTLow

Recommended Posts

  • Level 5*

For a scripting overview, see Scripting on a Mac (AppleScript)

The use of this script is to insert a keyword into a note, or attachment; for example Tag: Sample33515842_ScreenShot2018-07-15at21_37_00.png.b5796c3d4e145ff98bf3d45af743838d.png

  • Evernote's tag feature only works at the note level.
  • Keywords can be inserted anywhere in the contents
    Notes are retrieved using the text search feature; 
    for example  search "Tag: Sample"

The keyword is retrieved from the Tag list, starting at the top level and drilling down to the bottom level

set the clipboard to "Tag: " & Get_Keyword()

on Get_Keyword()
     
tell application "Evernote" to set theList to name of every tag whose parent is equal to missing value           -- Top Level List
     
repeat while count of theList > 0
         
set theList to simple_Sort(theList)
          set theTag to item 1 of (choose from list theList with prompt "Select Keywod") -- Choose from List
          set the clipboard to "Tag: " & theTag
           set theList to Child_List(theTag)                                                                          -- Drill down to the next level   
     end repeat
     
return theTag
end Get_Keyword

on Child_List(parentName)
     
set theList to {}
     
tell application "Evernote"
          
set parentTag to tag parentName
          
set theList to name of every tag whose parent is equal to parentTag
     
end tell
      return theList
end Child_List

Link to comment

Archived

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

×
×
  • Create New...