I’ve been trying to add a basic spaced repetition script in OmniOutlriner 5 Pro to work kind of like an sm-2 based flashcard system for regular reviews of information in my outline. I had previously tried org-drill and looked at a now abandoned program called MindBurn and could not find anything that quite worked for me. This script (below) is working so far, but I am hoping to be able to set a filter in the script that only shows rows with due dates greater than/equal to today.
Is it possible to set relative dates in filters rather than set dates selected through the gui? I haven’t been able to figure out how yet, but it seems like it should be possible
Current script:
(*
Create columns named topic, quality, due, numreps, and EF
*)
tell application "OmniOutliner"
tell front document
-- set topicText to ""
repeat with MyRow in every row
-- set cellValue to text of cell "topic" of MyRow
-- set topicText to topicText & cellValue
set baseEaseFactor to 1.3
set i to value of cell "numreps" of MyRow -- number of repetitions thus far
set q to value of cell "quality" of MyRow -- Get quality #
-- Set existing easiness factor...
if value of cell "EF" of MyRow contains "" then
set value of cell "EF" of MyRow to baseEaseFactor as text
set oldEF to baseEaseFactor
else
set oldEF to value of cell "EF" of MyRow -- Get oldEF
end if
-- If there have been no reps:
if i as integer is equal to 0 then
set nextDue to do shell script "date -v+0d +%Y-%m-%d" as string
set value of cell "due" of MyRow to nextDue as string
set value of cell "numreps" of MyRow to "1" as string
set value of cell "EF" of MyRow to baseEaseFactor as string
return
-- If there have been 2 reps:
else if i as integer is equal to 1 then
set i to i + 1
set value of cell "numreps" of MyRow to i as string
set dueCellValue to do shell script "date -v+1d +%Y-%m-%d" as string
set value of cell "due" of MyRow to dueCellValue as string
return
else if i as integer is equal to 2 then
set nextDue to do shell script "date -v+6d +%Y-%m-%d" as string
set value of cell "due" of MyRow to nextDue as string
set value of cell "numreps" of MyRow to "3" as string
set value of cell "EF" of MyRow to baseEaseFactor as string
return
else -- all other numbers
set value of cell "numreps" of MyRow to i + 1 as string
set newEF to oldEF - 0.8 + 0.28 * q - 0.02 * q * q
if newEF is less than 1.3 then
set newEF to 1.3
end if
if newEF is greater than or equal to 2.5 then
set newEF to 2.5
end if
set value of cell "EF" of MyRow to newEF as string
if q > 0 then
set nextDue to (i * (i - 1) * newEF) as integer
set dueCellValue to do shell script "date -v+" & nextDue & "d +%Y-%m-%d"
set value of cell "due" of MyRow to dueCellValue as string
set i to i + 1
set value of cell "numreps" of MyRow to i as string
else
set nextDue to do shell script "date -v+0d +%Y-%m-%d" as string
set value of cell "due" of MyRow to nextDue as string
set value of cell "numreps" of MyRow to "0" as string
end if
end if
end repeat
end tell
end tell