- 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版を作成