我在创建一个非常简单的 AppleScript 以从 Evernote 笔记中导出附件时遇到了重大问题。我已经多次使用以下代码,它似乎可以工作,但实际上它会默默地失败,即使事件日志显示正确的响应也是如此。
我听说 Evernote 的最新版本存在严重的 AppleScript 支持问题。如果有人是 Evernote 和 AppleScript 的“专家”,我也会非常感谢对我的脚本进行审查,以确保我不会忘记任何事情。
我正在使用 Mac OS X 10.8.2 和 Evernote 5.0.5 (400805) 的 Mac App Store 版本。
代码:
set ExportPath to "LegatusHD1:Users:me:Downloads:Test"
set theAttachments to {}
set selectedItems to {}
tell application "Evernote"
set selectedItems to selection
repeat with selectedItem in selectedItems
set theAttachments to (attachments of selectedItem)
repeat with theAttachment in theAttachments
set theFilename to (ExportPath & ":" & theAttachment's filename)
write theAttachment to theFilename
set theFilename to ""
end repeat
end repeat
end tell