Skip to content

Instantly share code, notes, and snippets.

@hetima hetima/gist:11212483
Created Apr 23, 2014

What would you like to do? 実行するたび締め切りが延びる魔法のスクリプト
tell application "Reminders"
set reminderTitle to "Shimekiri"
set listTitle to "work"
set workerList to list listTitle
-- remove old reminder
set ids to {}
repeat with r in reminder of workerList
if name of r is reminderTitle then
set the end of ids to (id of r)
end if
end repeat
repeat with idToDelete in ids
delete reminder id idToDelete
end repeat
-- add new reminder
set duedate to (current date) + (10 * days)
set rdate to duedate - (24 * hours)
tell workerList
set newToDo to make new reminder with properties {name:reminderTitle, due date:duedate, remind me date:rdate}
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.