Re: Moving Reminders that are due today to tomorrow
Re: Moving Reminders that are due today to tomorrow
- Subject: Re: Moving Reminders that are due today to tomorrow
- From: "Stockly, Ed via AppleScript-Users" <email@hidden>
- Date: Tue, 25 Apr 2023 17:03:31 +0000
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=latimes.com; dmarc=pass action=none header.from=latimes.com; dkim=pass header.d=latimes.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wA4XJZyVCoeBRedcCcoxaKCS44MOiJiVnMzbGXf1+8w=; b=IWb6DKteAWTWgwY9OaFpWxdpZoyLaJBBnzmllMBhuBa+y0lJanu45nAyPbS6D2jcKlWsbZU+cDglrd7NK8+tzfGW3N0ksC2Q7lLn2s+soQTCF2cWnEKE+aw+zhkqGuZ4tXJHMFpWmWINWuMSwnOzvfWkf7cN/AYKv6N4/wEv7MXWlkn/xjIXErdjSwnbNcRvox9iR3aREP2oUiVSEarH/Ekq1OjJvoBostbIUCM9nb8SziQYC+q4pr49IWzgg5JH9Cgu3De32YKmRuHYfHyWPwp8a6yHfyrMGods8ZCeq2UDoQnMkzy4ye0dzJF4aPcFPVeeHQMeqlslKyhb6qEXQg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RuSzjl/5+/DnWbXuPUkNlFsattbZEHHa5DaUPdps76iA2MP2VYAP+Ouz8dR+fpTaS50p7bm0pspqb044uaDBp05nG4XjerpfH4gwFJNPLfMO/ixSr4KSvmpr8iblhr+ofAQKIeL1QG9dEdirMpOLRO6hHW0WoHw8nRQ6/0TBp8Nu2PP9c12UtB5l6fgtgeZhvL5EJdR32ywUUQ1fJYKXPWNVWPVC2X3xadTScRnbF7yknAZGrX67A7POGL5ibVCLCfThDVpg3WqcNJ6a8utlFgJVPoVJZGgEm4sAKZyjEODeLTEXGt0W9E0ZSXSq21R0VLbaAh1HpdyOyY9OC+hHEw==
- Thread-topic: Moving Reminders that are due today to tomorrow
This seems to work for me.
I’ve noticed that if a reminder contains another reminder, the nested reminder
doesn’t show up.
Also, you may want to pull the time from the old reminder and use that for the
new reminder.
HTH
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
set currentDate to current date
copy currentDate to todayStart
copy currentDate to todayEnd
set time of todayStart to 0
set time of todayEnd to (24 * hours) - 1
set newDueDate to (todayStart) + 1 * days
tell application "Reminders"
set todayReminders to {}
set reminderLists to its lists
repeat with aList in reminderLists
set todayReminders to todayReminders & (reminders of
aList whose (due date ≥ todayStart) and (due date ≤ todayEnd))
end repeat
repeat with aReminder in todayReminders
tell aReminder
set oldDueDate to its due date
set its due date to newDueDate
display dialog "Updated reminder: " & name
& return & "Old due date: " & oldDueDate & return & "New due date: " & due date
end tell
end repeat
end tell
From: AppleScript Digest <email@hidden>
Reply-To: "email@hidden" <email@hidden>
Date: Tuesday, April 25, 2023 at 8:08 AM
To: AppleScript Digest <email@hidden>
Subject: Moving Reminders that are due today to tomorrow
At the end of the day, need to move the Reminders that were due today to
tomorrow? I do.
So I wrote this script. It compiles, and it runs, but it doesn’t actually
perform the action.
Any suggestions?
set currentDate to current date
set currentYear to year of currentDate
set currentMonth to month of currentDate as integer
set currentDay to day of currentDate
set todayStart to date ((currentMonth as string) & "/" & (currentDay as string)
& "/" & (currentYear as string) & " 12:00:00 AM")
set todayEnd to (todayStart + 24 * hours) - 1
set theDueDate to (current date) + 1 * days
tell application "Reminders"
set todayReminders to {}
repeat with aList in lists
set todayReminders to todayReminders & (reminders of aList whose (due date ≥
todayStart) and (due date ≤ todayEnd))
end repeat
repeat with aReminder in todayReminders
tell aReminder
set oldDueDate to due date
set due date to theDueDate
display dialog "Updated reminder: " & name & return & "Old due date: " &
oldDueDate & return & "New due date: " & due date
end tell
end repeat
end tell
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden