LoginSignup
1
1

More than 5 years have passed since last update.

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

Posted at
  • 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版を作成
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1