The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniFocus 1 for Mac (http://forums.omnigroup.com/forumdisplay.php?f=38)
-   -   iCal Publishing and Due Dates > 2 Weeks Away (http://forums.omnigroup.com/showthread.php?t=22225)

joncgde2 2011-09-26 12:50 AM

iCal Publishing and Due Dates > 2 Weeks Away
 
Hi

I have a quick question: Is there a way to enable OF to publish due reminders in iCal that are more than 2 weeks away?

I have a few due dates for tasks in 3 or 4 weeks, and it would be nice to see them at a glance in iCal as 'prompts' that I need to pay attention to these.

It would be nice if there was the ability to specify how far away you want due reminders to be before they are published.

In my case, I would prefer ALL due dates to be published in my OF calendar.

I like how OF takes care of the 'fuzzy' stuff, but I like the thought of having all my 'hard' dates in iCal. E.g. meetings must occur on a certain day and time, and so too do particular tasks with due dates. Having only tasks due in the next 2 week show up in iCal seems kind of arbitrary, and is a bit frustrating.

Also, it would be good if tasks with a start and an end date could be put in iCal as multi-day events spanning days from start to end dates. Or at least having this as an option.


But my main gripe is the "due dates must be within 2 weeks to be published in iCal" issue. Why not have ALL due dates published in the calendar? :(

Any suggestions/tips?


Thanks

Jon

joncgde2 2011-10-01 04:32 PM

Hello?


Is there anyone that can help me with this? :(

whpalmer4 2011-10-01 06:28 PM

You're using a feature in a way that wasn't intended. The publishing of due dates to the OmniFocus Reminders calendar was a stopgap to get reliable notifications of impending due dates on iOS gadgets which couldn't be counted upon to have internet connectivity at the time of the notification. They are only published two weeks out to keep the amount of work done each time the app syncs reasonable; two weeks should be plenty to allow most people to have a sync opportunity (to get the notification data on their device) between the time the action with a due date is entered in OmniFocus and when it is due.

That said, I can see how one might want to be able to view a calendar with one's due dates, and even started drafting an Applescript to do that, but life has intervened, and I don't know when I'll get back to that little project. You might search the OmniFocus Extras forum and see if there is something there that helps you do what you want.

jakobox 2011-10-22 09:51 AM

Just wanted to chime in that I would love to see this as a possibility as well.... I know that calendar syncing has been much discussed in these forums. For me, the "publish due reminders as calendar" might be sufficient for my needs, if only it would publish everything, and not only the items that are 2 weeks or less out.

As a user of OF for probably over 2 years, and an owner of every product (iphone, ipad, desktop), this is the one sticking point for me that I would really love to see addressed.

Ken Case 2011-10-23 02:49 PM

There's a sample "Publish to iCal" script which runs through all your contexts and creates a new calendar for each one (named "OF: [Context]"), adding any available tasks from that context to that calendar.

The script ships with every copy of OmniFocus: you can find it by Control-Clicking on the OmniFocus app in the Finder, choosing "Show Package Contents" from the contextual menu and navigating into Contents/Resources/SampleScripts.

It wouldn't be difficult to modify the sample script to publish all the tasks into a single calendar instead, or into a specific calendar (such as your default iCloud calendar)—or to create events in iCal rather than "to do"s.

Hope this helps!

whpalmer4 2011-10-23 08:40 PM

[QUOTE=Ken Case;103265]There's a sample "Publish to iCal" script which runs through all your contexts and creates a new calendar for each one (named "OF: [Context]"), adding any available tasks from that context to that calendar.
[/quote]
It's a great script, except for two minor annoyances — it omits nested contexts, and it crashes when you run it, unless you happen to already have calendars named OF: <context> for all of your contexts :-)

A somewhat improved script is provided below. There's an property up top you can edit to control whether the script exports available or remaining actions. It traverses into nested contexts. It does not print the full project name for a project nested in a folder; that will be a fine learning exercise for someone who needs it. No attempt is made to make the calendar events show the amount of time required for various due items, because I don't believe that is useful in most cases. If you feel otherwise, you know where the sources are, knock yourself out :-)

[code]
(*
Copyright 2007 The Omni Group. All rights reserved.

$Header: svn+ssh://source.omnigroup.com/Source/svn/Omni/branches/OmniFocus/1.x/OmniGroup/Applications/OmniFocus/Extras/SampleScripts/Publish%20to%20iCal.applescript 93889 2007-11-02 18:06:50Z bungi $
*)

property pExportAvailableTasksOnly : false -- if false, export remaining tasks; if true, export available tasks

global currentTargetCalendar

tell first document of application "OmniFocus"

repeat with aContext in flattened contexts
set MyContextID to (id of aContext)
set MyContext to context id MyContextID
CreateContextCalendar of me from MyContext -- also deletes existing calendar
if ((count of (my GetTasks(MyContext))) > 0) then
PublishContext of me from MyContext
end if
end repeat

end tell

tell application "iCal" to activate

on GetTasks(SomeContext)
using terms from application "OmniFocus"
if (pExportAvailableTasksOnly is true) then
return tasks of SomeContext where blocked is false
else
return tasks of SomeContext where completed is false
end if
end using terms from
end GetTasks

on CreateContextCalendar from SomeContext
tell application "iCal"
set CalendarName to "OF: " & my FullContextName(SomeContext)
try
delete (first calendar whose name is CalendarName)
end try
using terms from application "OmniFocus"
set ContextTasks to my GetTasks(SomeContext)
end using terms from
set currentTargetCalendar to make calendar with properties {name:CalendarName}
end tell
end CreateContextCalendar

on PublishContext from SomeContext
using terms from application "OmniFocus"
PublishContextTasks of me from SomeContext
repeat with childContext in contexts of SomeContext
PublishContext of me from childContext
end repeat
end using terms from
end PublishContext

on PublishContextTasks from SomeContext
using terms from application "OmniFocus"
set MyTasks to my GetTasks(SomeContext)
repeat with aTask in MyTasks
set taskName to name of aTask
set taskProject to containing project of aTask
set completionDate to completion date of aTask
set dueDate to due date of aTask
if (dueDate is not missing value) then
set dueDate1 to dueDate + 60 -- if we make zero-length appointments, iCal puts them on top of each other. Make them a minute long and it spreads them out a bit.
end if

local MyEvent
using terms from application "iCal"
tell currentTargetCalendar
if completionDate is equal to missing value and dueDate is not missing value then
if taskProject is not equal to missing value then
set MyEvent to make new event at end of events with properties {summary:my FullContextName(SomeContext) & ": " & taskName & " [" & name of taskProject & "]", start date:dueDate, end date:dueDate1}
else
set MyEvent to make new event at end of events with properties {summary:my FullContextName(SomeContext) & ": " & taskName & " [Inbox]", start date:dueDate, end date:dueDate1}
end if
end if
end tell
end using terms from
end repeat
end using terms from
end PublishContextTasks

-- return full name of context, or "(None)"
-- uses ":" as hierarchy separator, as OmniFocus does not appear to expose
-- the value conveniently
on FullContextName(SomeContext)
using terms from application "OmniFocus"
local oContext
local strContextName

set strContextName to ""
set oContext to SomeContext
if (oContext is missing value) then
return "(None)" -- easy case!
end if

-- if there is a context set, we need to construct the full name,
-- climbing up the tree to the top. We take the name of our starting
-- point, then look at the container. Each time the container is not
-- of class document, there's another layer, and we tack its name on
-- to the front of the string.
set strContextName to name of oContext
repeat while (class of (container of oContext) is not document)
set strContextName to ":" & strContextName
set oContext to container of oContext
set strContextName to name of oContext & strContextName
end repeat
return strContextName
end using terms from
end FullContextName


[/code]


All times are GMT -8. The time now is 06:57 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.