7

AppleScriptを使用して、Evernotev.3.3.0からHTML形式のノートをディスク上の場所にエクスポートしようとしています。手元のタスクは特に複雑ではないようですが、私はEvernoteに比較的慣れておらず、AppleScriptにまったく慣れていないのであまり役に立ちません...;)

これが私がこれまでに思いついたものです-コメントは大歓迎です!

tell application "Evernote"
    set allmynotes to find notes
    set outputpath to "/Users/{myusername}/Desktop/Test"
    export allmynotes to outputpath format HTML
end tell

私の理解では、HTMLとしてエクスポートすると、ノートごとに1つのファイルが作成されるため、出力ファイル名ではなく出力フォルダー名を指定する必要があると思いました。もう1つの前提は、スクリプトをダブルクリックすると、アクティブユーザーの資格情報で実行されるという事実です。私のマシンでは、このユーザーは指定されたフォルダーに書き込むための十分なアクセス許可を持っています。

これまでの結果はとEvernote got an error: Unable to remove existing output file." number 1ですEvernote got an error: Unable to create output directory.。何か案は?

よろしくお願いします!:)

4

5 に答える 5

8

ついに勝利!この問題は私のスクリプトとは何の関係もありませんでしたし、AppStoreからEvernoteをインストールしたという事実とすべてが関係していました。App Storeのバージョンは、evernote.comからダウンロードできるバージョンとは異なり、Mac OSXのAppSandboxingによって制限されます。現在、App Store以外のバージョンがインストールされているため、上記のスクリプトは完全に機能します。

回答ありがとうございます。同じ問題が発生している方にも感謝します。上記の問題も解決されることを願っています。

于 2013-08-07T18:10:36.090 に答える
1

3.3のバグだと思います-私はEvernote用にかなりの数のAppleScript(エクスポート機能が機能しているものを含む)を作成しましたが、最近同じタイプの「許可」エラーが発生しました。

私がEvernote開発者サポートに連絡したとき、彼らは彼らのチームが現在問題を検討していると答えました。私は彼らの参照のためにこのページを彼らに転送します、そしてうまくいけば、バージョン3.3.1は修正をもたらすでしょう!

于 2012-08-16T13:55:23.880 に答える
0

あなたは近かった:

set outputpath to (path to desktop as text) & "Evernote Test"
do shell script "mkdir -p " & quoted form of POSIX path of outputpath

tell application "Evernote"
    set allmynotes to find notes
    export allmynotes to outputpath format HTML
end tell
于 2012-08-13T22:41:05.890 に答える
0

Evernote 5.2.1(Mac OS X 10.8.4)では、出力フォルダーが既に存在するかどうかに関係なく、adayzdoneの回答が確実に機能することを確認できます。指定されたフォルダが存在する場合、Evernoteはそれをゴミ箱に移動し、新しいフォルダを作成します。

元の質問から、エッジケース(既存の以前のエクスポートフォルダーなど)の処理方法に関する不確実性を収集します。このような場合をダイアログで処理するためのコードを次に示します。

set folderName to "Latest Evernote HTML Export"
set exportFolder to (path to documents folder as text) & folderName as text
tell application "Finder"
    if exportFolder exists then
        set answer to the button returned of (display dialog "This will overwrite the previous Evernote HTML export" buttons {"Stop", "Overwrite"} default button 1)
        if answer is equal to "Stop" then
            error number -128 -- end script with error "User Cancelled"
        end if
    end if
end tell

tell application "Evernote"
    set allNotes to find notes
    export allNotes to exportFolder format HTML
end tell

テストのヒント:Evernoteライブラリ全体(非常に大きくなる可能性があります)のエクスポートを回避するために、 allNotesの2つのオカレンスを{firstNote、secondNote}に置き換えることができます。

于 2013-08-05T19:52:00.880 に答える
0
set folderName to "Latest Evernote HTML Export"
set exportFolder to (path to documents folder as text) & folderName as text
tell application "Finder"
    if exportFolder exists then
        set answer to the button returned of (display dialog "This will overwrite the previous Evernote HTML export" buttons {"Stop", "Overwrite"} default button 1)
        if answer is equal to "Stop" then
            error number -128 -- end script with error "User Cancelled"
        end if
    end if
end tell

tell application "Evernote"
    set allNotes to find notes
    export allNotes to exportFolder format HTML
end tell
于 2017-08-15T12:52:52.487 に答える