仅从 evernote 导出标签?
Export tags ONLY from evernote?
我发现了这个:Using Applescript to export list of URLs based on tags?,这是一个很好的资源。原始脚本(来自 Veritrope)有点旧,但非常适合导出 Evernote 笔记标题。我认为修改此脚本以将笔记本中的标签转换为 CSV 会相对容易。但是由于我在编写脚本方面非常业余,而且self-taught,我无法让它工作。
任何人都可以指出我正确的方向吗?我的最终目标是进行一些标签维护,因为我现在的标签太多了,它们不再很有用了。所以我只想要一个标签列表——不必与笔记相关联。一栏数据。
谢谢,stackies。
这是一个 AppleScript 程序,可以执行您希望执行的操作:
tell application "Evernote"
set tagList to {}
set allNotebooks to every notebook
repeat with currentNotebook in allNotebooks
set allNotes to every note in currentNotebook
repeat with currentNote in allNotes
set noteTags to (the tags of currentNote)
repeat with currentTag in noteTags
if tagList does not contain name of currentTag then
set the end of tagList to name of currentTag
end if
end repeat
end repeat
end repeat
end tell
set filePath to (path to desktop as text) & "Evernote Tags.csv"
set output to ""
repeat with currentTag in tagList
set output to output & currentTag & ", "
end repeat
set theResult to writeTo(filePath, output, text, false)
if not theResult then display dialog "There was an error writing the data!"
on writeTo(targetFile, theData, dataType, apendData)
-- targetFile is the path to the file you want to write
-- theData is the data you want in the file.
-- dataType is the data type of theData and it can be text, list, record etc.
-- apendData is true to append theData to the end of the current contents of the file or false to overwrite it
try
set targetFile to targetFile as text
set openFile to open for access file targetFile with write permission
if apendData is false then set eof of openFile to 0
write theData to openFile starting at eof as dataType
close access openFile
return true
on error
try
close access file targetFile
end try
return false
end try
end writeTo
我发现了这个:Using Applescript to export list of URLs based on tags?,这是一个很好的资源。原始脚本(来自 Veritrope)有点旧,但非常适合导出 Evernote 笔记标题。我认为修改此脚本以将笔记本中的标签转换为 CSV 会相对容易。但是由于我在编写脚本方面非常业余,而且self-taught,我无法让它工作。
任何人都可以指出我正确的方向吗?我的最终目标是进行一些标签维护,因为我现在的标签太多了,它们不再很有用了。所以我只想要一个标签列表——不必与笔记相关联。一栏数据。
谢谢,stackies。
这是一个 AppleScript 程序,可以执行您希望执行的操作:
tell application "Evernote"
set tagList to {}
set allNotebooks to every notebook
repeat with currentNotebook in allNotebooks
set allNotes to every note in currentNotebook
repeat with currentNote in allNotes
set noteTags to (the tags of currentNote)
repeat with currentTag in noteTags
if tagList does not contain name of currentTag then
set the end of tagList to name of currentTag
end if
end repeat
end repeat
end repeat
end tell
set filePath to (path to desktop as text) & "Evernote Tags.csv"
set output to ""
repeat with currentTag in tagList
set output to output & currentTag & ", "
end repeat
set theResult to writeTo(filePath, output, text, false)
if not theResult then display dialog "There was an error writing the data!"
on writeTo(targetFile, theData, dataType, apendData)
-- targetFile is the path to the file you want to write
-- theData is the data you want in the file.
-- dataType is the data type of theData and it can be text, list, record etc.
-- apendData is true to append theData to the end of the current contents of the file or false to overwrite it
try
set targetFile to targetFile as text
set openFile to open for access file targetFile with write permission
if apendData is false then set eof of openFile to 0
write theData to openFile starting at eof as dataType
close access openFile
return true
on error
try
close access file targetFile
end try
return false
end try
end writeTo