Posted at

Cocoaの機能を使ってRemindersで新規リストを作成するAppleScript

More than 3 years have passed since last update.


  • Reminders.appにはAppleScript用語辞書があり、リストを作成できる

  • CocoaではEKEventStoreクラスとEKReminderクラスを使ってリストを作成する

  • 下2つのAppleScriptは同じ操作


    • Cocoaの機能を使った方はReminders.appを起動しなくても使える




make_new_list_in_Reminders_from_pure_AppleScript.scpt

tell application "Reminders"

make new list with properties {name:"New List from pure AppleScript"}
end tell


make_new_list_in_Reminders_from_ASObjC.scpt

use framework "EventKit"

set eventStore to current application's EKEventStore's alloc()'s initWithAccessToEntityTypes:(current application's EKEntityMaskReminder)
set calendar to current application's EKCalendar's calendarForEntityType:(current application's EKEntityTypeReminder) eventStore:eventStore
set calendar's title to "New List from ASObjC"
set calendar's source to eventStore's defaultCalendarForNewReminders's source
eventStore's saveCalendar:calendar commit:true |error|:(missing value)



更新履歴


  • 2016-08-27: pure AppleScript版とASObjC版を作成