我在Evernote中使用基于GTD的系统,其中每个项目都有一个标签。我的一些项目处于非活动状态,并且没有下一步的行动' - 即标签没有附注。昨晚我偶然点击了Delete unused Account tags
,我的备份都没有丢失数据;我是一个非常伤心的兔子。
将来如何备份这些未使用的标签?我更喜欢ENEX,但我很满意一个纯文本的名单。
我正在使用Evernote' export'菜单选项,但事实证明 - 只导出笔记及其标签,而不是未使用的标签。我已经尝试了ENScript.exe(ENScript exportNotes /q any:
)并且也做了同样的事情:notes&他们的标签,但没有其他标签。我唯一要做的就是安装一个SDK并且自己动手制作一个SDK。调用NoteStore.listTags - 鉴于之前的两个结果,我无法确定是否有效。
有没有办法从Evernote导出未使用的标签? API能做到吗?
答案 0 :(得分:1)
是的,您可以通过API。使用listTags
方法获取您的Evernote帐户中的所有标记,这将列出“附加”到注释的标记和未附加到注释的标记。然后,您可以通过在每个笔记本上调用listTagsByNotebook
将其与“附加”到笔记的笔记进行比较(您可以通过调用listNotebooks
方法获取所有笔记本的列表)。 Evernote的Cloud API与其本地脚本API(即AppleScript和VBScript)不同
listTagsByNotebook
documentation
以下示例在Python中:
from evernote.api.client import EvernoteClient
#setup Evernote Client
client=EvernoteClient(token="S=s432:U=489be66:E=1545a0ad962:C=14d0259ad08:P=1cd:A=en-devtoken:V=2:H=e3e3c9ea30c6879c54918794fad333ae", sandbox=False)
#get note store object to call listTags, listTagsByNotebook, and listNotebooks on
noteStore=client.get_note_store()
tags=noteStore.listTags() #get list of all tags
allTags = [tag.name for tag in tags] #put all the names of the tags in a list
#get a list of all notebooks
notebooks = noteStore.listNotebooks()
#get all tags for each notebook and store them in a list
attachedTags = []
for notebook in notebooks:
notebookTagList = noteStore.listTagsByNotebook(notebook.guid)
notebookTagNames = [tag.name for tag in notebookTagList]
attachedTags+=notebookTagNames
#compare lists and print "unattached" tags
print("\nThe following is a list of \"unattached\" tag names in your Evernote account:")
for tag in allTags:
if tag not in attachedTags:
print(" *%s"%tag)
print("")
您可以在此处获取生产帐户的开发人员令牌(Evernote也为开发人员提供了沙箱):https://www.evernote.com/api/DeveloperToken.action
Evernote SDK在Github上:https://github.com/evernote