如何用applescript把epub导入印象笔记?

首先,下载一个epub文件,改后缀名为zip,然后解压,得到一批html文件。切换到那个目录,把下面代码的路径改一下就可以!

打开python,生成一个文件名列表!因为我实在不会用applescript生成这个alias列表。但是印象只能识别这个alias列表。

import os

s=[]

for x in os.listdir('/Users/Documents/html/text'):

s.append('alias "Macintosh HD:Users:Documents:html:text:'+str(x)+'"')

p=(','.join(s))

f=open('ceshi.txt','w')

f.write(p)

f.close()

os.system('open /Users/Documents/ceshi.txt')

之后打开script editor。输入如下代码,把{}里用上面的结果填充!(也就是地址列表)

set to {}

repeat with x1 in x

tell application "Evernote"

create note from file x1

end tell

end repeat

这样就OK了!

你可能感兴趣的:(如何用applescript把epub导入印象笔记?)