Help us understand the problem. What is going on with this article?

Evernoteの全ノートに含まれる作成者を取得するAppleScriptハンドラ

More than 3 years have passed since last update.
  • Evernoteのノートには「作成者」情報がある
    • メールからノートを作成すると、送信元アドレスが作成者になる
  • あるノートから作成者を取得する方法
    • tell application "Evernote" to get author of note 1 of notebook 1
  • ある作成者のノートだけを取得する方法
    • tell application "Evernote" to find notes "author:作成者"
  • 下のAppleScriptは全ノートに含まれる作成者を取得してリストにするハンドラ
everyAuthorInEvernote.scpt
use scripting additions
use framework "Foundation"

my everyAuthorInEvernote()

on everyAuthorInEvernote()
    return text of my everyParameterOfNotesInEvernote("author")
end everyAuthorInEvernote

on everyParameterOfNotesInEvernote(noteParameter as text)
    --require framework: Foundation
    set everyParameter to current application's NSMutableSet's |set|()
    repeat with parameterList in run script "tell application \"Evernote\" to return " & noteParameter & " of notes of notebooks"
        (everyParameter's addObjectsFromArray:parameterList)
    end repeat
    set comparator to my appropriateComparatorToSort(everyParameter's anyObject())
    set sortDescriptor to current application's NSSortDescriptor's sortDescriptorWithKey:"self" ascending:true selector:comparator
    return (everyParameter's sortedArrayUsingDescriptors:{sortDescriptor}) as list
end everyParameterOfNotesInEvernote

on appropriateComparatorToSort(anObject)
    --require framework: Foundation
    if anObject  missing value and (anObject's respondsToSelector:"localizedCaseInsensitiveCompare:") then
        return "localizedCaseInsensitiveCompare:"
    else
        return "compare:"
    end if
end appropriateComparatorToSort

更新履歴

  • 2016-03-02: everyAuthorInEvernoteハンドラ作成
szk-3
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away