OmniFocus Reminders

I have not used this script until this morning, and I am having trouble making it work. Here’s what I do:

Select a file in DTPO for which I want to set a deadline in OF > Script > Add as To Do to OF (extended) > I wrote an absolute date, i.e. my deadline. In a couple of seconds, however, I receive a floating window with the message: “Unable to parse date 3/15/17”. I tried writing the date as 03/15/17 and 03/15/2017, but DTPO does not like any of these options.

Does the script work? What do I need to change to make it work?

That’s a script that Rob Trew contributed to the forum, maybe six years ago. I just looked into it in Script Debugger and it has all sorts of things broken. It was written against an old version of OmniFocus and an equally old version of DEVONthink. You’d have to tweet Rob (at-complexpoint) and see if he’s willing to fix it. It’s not something DEVONtech would fix.

see: Integration of Devonthink Pro with Omnifocus 2 (Rob Trew)

You might find one of these helpful:

Which system language do you use?

OP, I no longer use the Add to OmniFocus (extended) reminder script from the More Scripts… menu for the reason you state and Korm discovered. Instead, I am quite happy using the built-in script which has the attached pop-up selector when run.

Here is the script in case yours got broken:

-- Script to add a selected record to OmniFocus as a to do
-- Written by Eric Böhnisch-Volkmann, Version 1.0.2, Aug 10, 2010
-- © 2010-2014 DEVONtechnologies, LLC


-- Set properties
property pDaysIntoFuture : -1 -- Created to do will have a due date n days in the future
property pPrefix : "Reminder" -- Prefix for the created to do item
property pDelays : {{displayname:"No due date", value:-1}, {displayname:"Tomorrow", value:1 * days}, {displayname:"In two days", value:2 * days}, {displayname:"In three days", value:3 * days}, {displayname:"In one week", value:1 * weeks}, {displayname:"In two weeks", value:2 * weeks}, {displayname:"In one month", value:4 * weeks}, {displayname:"In two months", value:8 * weeks}, {displayname:"In three months", value:90 * days}, {displayname:"In six months", value:180 * days}, {displayname:"In one year", value:365 * days}}
property pDefaultDelay : "In one week"

-- Import helper library
tell application "Finder" to set pathToAdditions to ((path to application id "DNtp" as string) & "Contents:Resources:Template Script Additions.scpt") as alias
set helperLibrary to load script pathToAdditions

try
	-- Get the selection
	tell application id "DNtp" to set thisSelection to the selection
	
	-- Error handling
	if thisSelection is {} then error localized string "Please select a document or group, then try again."
	if (length of thisSelection) > 1 then error localized string "Please select only one document or group, then try again."
	
	-- Get and format the data we need
	set pLocalizedPrefix to localized string pPrefix
	tell application id "DNtp"
		set thisItem to first item of thisSelection
		set theSummary to (pLocalizedPrefix & ": " & name of thisItem) as string
		set theURL to (reference URL of thisItem) as string
	end tell
	
	-- Let the user choose when to receive the reminder
	-- Convert array into localized arrays
	set pLocalizedDelays to {}
	set pLocalizedDelayNames to {}
	repeat with theDelay in pDelays
		set pLocalizedDelays to pLocalizedDelays & {{displayname:localized string (displayname of theDelay), value:(value of theDelay)}}
		set pLocalizedDelayNames to pLocalizedDelayNames & {localized string (displayname of theDelay)}
	end repeat
	set theChoice to choose from list pLocalizedDelayNames with title (localized string "Set reminder") with prompt (localized string "Please choose when you want to get reminded of the item") & " \"" & theSummary & "\"" & (localized string "%choice prompt end%") & ":" default items {pDefaultDelay}
	if theChoice is false then return false -- If the user pressed Cancel, exit
	set theDelayValue to pDaysIntoFuture -- Assume default
	try
		-- Find the number of days associated with the user's choice
		repeat with theDelay in pLocalizedDelays
			if ((displayname of theDelay) as string) is equal to (theChoice as string) then set theDelayValue to (value of theDelay)
		end repeat
	end try
	
	-- Calculate due date
	if theDelayValue ≥ 0 then set theDueDate to (date (date string of (current date))) + theDelayValue
	
	-- Add new to do to OmniFocus
	try
		tell application "OmniFocus"
			if theDelayValue ≥ 0 then
				tell default document to set newTask to make new inbox task with properties {name:theSummary, due date:theDueDate, note:theURL}
			else
				tell default document to set newTask to make new inbox task with properties {name:theSummary, note:theURL}
			end if
		end tell
	on error errmsg
		display alert (localized string "OmniFocus is not available. You may need to update to OmniFocus Pro to use this script.")
	end try
	
on error errmsg
	
	display alert (localized string "Error when adding item to OmniFocus") message errmsg
	
end try

I find the built-in script works well too.
I know time is a scarce commodity, but there may be some benefit in reviewing the available scripts & clearing out the ones which no longer work.

I thought I saw a note in the recent update of DT Pro that OmniFocus reminders has been fixed. Did I misread? In any case, I attempted to set a reminder this morning for a RTF I am working on. I went to scripts/reminders and selected OF. I entered absolute date and got the same window reported below about the date being unable to be parsed.

@Jamie: If you are referring to the Add to OmniFocus (extended), this is not the script we fixed. The non-extended version supports custom dates now.

@BlueFrog
Yep, I see it now. Thanks so much

No problem. Cheers!