Moving from Omnifocus to Reminders
property defaultList : “Inbox”
tell application “OmniFocus”
activate
tell front document of application “OmniFocus”
set theProjects to flattened projects — Gets all projects, ignoring folders
repeat with aProject in theProjects
set projectName to name of aProject
set projectStatus to completed of aProject
— Process only if the project is not completed
if not projectStatus then
set theTasks to tasks of aProject
— Create a list in Reminders for each non-completed project
my createListInReminders(projectName)
repeat with aTask in theTasks
set taskStatus to completed of aTask
— Process only if the task is not completed
if not taskStatus then
set theTaskName to name of aTask
set theNote to note of aTask
set theDueDate to due date of aTask
set isFlagged to flagged of aTask — Check if the task is flagged
— Determine priority based on flagged status
set thePriority to 0 — default no priority
if isFlagged then
set thePriority to 1 — high priority for flagged tasks
end if
— Add tasks to the corresponding list in Reminders
my createReminder(projectName, theTaskName, theDueDate, theNote, thePriority)
end if
end repeat
end if
end repeat
end tell
end tell
on createListInReminders(listName)
tell application “Reminders”
if not (exists (list listName)) then
make new list with properties {name:listName}
end if
end tell
end createListInReminders
on createReminder(thelist, theTask, theDate, theNote, thePriority)
try
set theBody to theNote
tell application “Reminders”
if not (exists (list thelist)) then
my createListInReminders(thelist)
end if
tell list thelist of default account
if theDate is not missing value then
make new reminder with properties {name:theTask, remind me date:theDate, body:theBody, priority:thePriority}
else
make new reminder with properties {name:theTask, body:theBody, priority:thePriority}
end if
end tell
end tell
on error
— Error handling can be implemented here if needed
end try
end createReminder
Please leave comments below.
*** This is a Security Bloggers Network syndicated blog from Joel Esler authored by Joel Esler. Read the original post at: http://blog.joelesler.net/2023/11/moving-from-omnifocus-to-reminders.html