Evernote和SBApplication桥 - createNoteWithENML问题 - 资源添加两次

时间:2016-04-22 08:29:21

标签: objective-c cocoa applescript evernote applescript-objc

问题:

//Create Evernote App SBApplication

  EvernoteApplication *evernoteApp = [SBApplication applicationWithBundleIdentifier:@"com.evernote.Evernote"];
    evernoteApp.delegate = self;

//Take this ENML Code
NSString *enml = @"<div>This is an encrypted text for OneNote Saferoom.</div><div><br/></div><div>PDF file</div><div><en-media type=\"application/pdf\" style=\"cursor:pointer;\" height=\"43\" hash=\"fa7d7e650b2cec68f302b31ba28235d8\"/></div><div><br/></div><div>Image</div><div><en-media style=\"height: auto;\" type=\"image/png\" hash=\"64957a2bd851f625383a5b9e410965d7\"/></div>";

//Create correct Array of URLS for above (Set the URLs before)
NSArray *resourceURLs = [NSArray arrayWithObjects:url2,url1,nil];

//Upload the note to Evernote
[evernoteApp createNoteFromFile:nil fromUrl:nil withText:nil withHtml:nil withEnml:[NSString stringWithFormat:@"<en-note>%@</en-note>",enml]  title:noteTitle notebook:workingNotebook tags:tags attachments:resourceURLs created:nil];

现在我得到了带有额外重复资源的注释(Evernote app只是将resourceURLs数组中的所有资源添加到注释的末尾):

Problem with Duplicated resources

尝试以下

  • 删除resourceURLs数组 - 未添加资源
  • 使用HTML并添加资源URL - 不保留结构,资源仅显示在最后
  • 使用内联资源功能(ENMLUtility)从ENML转换为HTML - 不显示资源

我开始相信Evernote.app如何处理createNote请求有一个错误。

要测试的资源

我们将不胜感激。

更新1: 使用纯AppleScript进行测试时,仍然会重复资源: https://www.dropbox.com/s/rvpc4est8ef7q4c/EvernoteAppleScript_bug.scpt?dl=0

谢谢, 髂骨

0 个答案:

没有答案