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_reminder_from_pure_AppleScript.scpt
tell application "Reminders"
    make new reminder at default list with properties {name:"New Reminder from pure AppleScript"}
end tell
make_new_reminder_from_ASObjC.scpt
use framework "EventKit"

set eventStore to current application's EKEventStore's alloc()'s initWithAccessToEntityTypes:(current application's EKEntityMaskReminder)
set reminder to current application's EKReminder's reminderWithEventStore:eventStore
set reminder's title to "New Reminder from ASObjC"
set reminder's calendar to eventStore's defaultCalendarForNewReminders
eventStore's saveReminder:reminder commit:true |error|:(missing value)

更新履歴

  • 2016-08-26: 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