taskbridgeapp.reminders.model.reminderscript.add_reminder_script
- taskbridgeapp.reminders.model.reminderscript.add_reminder_script = 'on run argv\nset {r_id, r_name, r_body, r_completed, r_completed_date} to {item 1, item 2, item 3, item 4, item 5} of argv\nset {r_due_date, r_allday_due, r_remind_date, r_list} to {item 6, item 7, item 8, item 9} of argv\ntell application "Reminders"\n set mylist to list r_list\n tell mylist\n if r_id is equal to "" then\n set theReminder to make new reminder at end of mylist\n else\n set theReminder to reminder id r_id\n end if\n set name of theReminder to r_name\n if r_body is not equal to "" then\n set body of theReminder to r_body\n end if\n set completed of theReminder to r_completed\n if r_completed_date is not equal to "" then\n set completion date of theReminder to my stringToDate(r_completed_date)\n end if\n if r_remind_date is not equal to "" then\n set remind me date of theReminder to my stringToDate(r_remind_date)\n end if\n if r_due_date is not equal to "" then\n if r_allday_due is true then\n set allday due date of theReminder to my stringToDate(r_due_date)\n else\n set due date of theReminder to my stringToDate(r_due_date)\n end if\n end if\n end tell\nend tell\n return id of theReminder\nend run\n\non stringToDate(theDateStr)\n set theDate to date theDateStr\n return theDate\nend stringToDate\n'
Add a new reminder to the given list in the default account.