The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniPlan > OmniPlan General
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Looking to iCal for staff Calendar info Thread Tools Search this Thread Display Modes
Hallo.

One of the things I love about OmniPlan, in theory, is time estimates for how long I can reasonably expect a large, complex project will take.

However, I work three jobs apart from the major home-construction project I'm using OmniPlan for, and my other family members and helpers also have complex lives. We all use iCal and share calendars to let each other know when we're available. I work all hours, lots of overtime, and sometimes have to re-schedule at the drop of a hat. This is all complex enough without having to do it twice, by putting my schedule into OmniPlan as well.

I need to have OmniPlan look to iCal for a given calendar which would represent time available to work on the project.

I think I've mentioned this in the past, but it was a long time ago. Is it on the feature list for 2.0? Without it, OmniPlan's utility is significantly limited.

Thanks,

-Speireag.
 
Judging from the OmniPlan Applescript dictionary, the necessary bits and pieces are there now to write a script that could build up the work schedule for a resource from an iCal calendar.
 
Quote:
Judging from the OmniPlan Applescript dictionary, the necessary bits and pieces are there now to write a script that could build up the work schedule for a resource from an iCal calendar.
That would work fine, even if I had to invoke it each time. I don't need time estimates every other minute.

I could probably puzzle this out, but it would take me a long time. I've never done any AppleScripting from scratch.

Has anyone already done this, or something very similar?

-Speireag.
 
Looking in iCal or a CalDAV server to figure out when a staff resource (or even equipment) is free or busy is something we've talked about. I'm not convinced it's possible to get "right". I'm just not sure how it would interact with the way real people actually do their scheduling.

When I manage developers, I figure out that I expect them to apply, say, 6 hours of effort every day to tasks I assign them, minus time off. I would hate to have OmniPlan automatically split tasks around dentist appointments, staff meetings, lunch, or scheduled telephone calls. If those items should make it into my calendar and get factored into my Plan, I'd find it pretty distracting.

Of course, the answer is to put those events into a calendar that OmniPlan is _not_ looking at. Which seems like it could work. If you put tasks in your calendar that are already in your Plan, there will be a collision OmniPlan couldn't resolve, and this will be Your Problem. So I think this amounts to affiliating a resource w/ a calendar and keeping the events synched up as exceptional off hours in the work schedule for that resource.

Well, if I've figured out your intent correctly I think that whpalmer has the right idea for a first step... see if this feature can begin life as an AppleScript successfully. It's not my forte, but maybe I can bludgeon together a start when I should really be working on the next great thing.

-Tom
 
Well, I surprised myself. This works, but I'm sure there are bugs and limitations. One known one is that it doesn't handle recurring events. iCal just gives you a recurrence rule and lets you figure out when the event will recur (see RFC 2445 and, well, don't look at me...). It will also not remove exceptions should an event be removed from your calendar.

So... regard this as a crude starting point?

Code:
tell application "iCal"
	set startDates to start date of every event of calendar named "Work"
	set endDates to end date of every event of calendar named "Work"
end tell

tell application "OmniPlan"
	tell front document
		tell schedule of resource named "Resource 1"
			repeat with eIndex from 1 to count of startDates
				set startDate to time string of (item eIndex of startDates)
				set endDate to time string of (item eIndex of endDates)
				subtract work time from my shortDate(startDate) to my shortDate(endDate) on item eIndex of startDates
			end repeat
		end tell
	end tell
end tell

-- unfortunately the time parsing barfs if seconds are included
on shortDate(MyDate)
	set Pos to offset of ":" in MyDate
	set hour to characters 1 thru (Pos - 1) of MyDate as string
	set MyDate to characters (Pos + 1) through end of MyDate as string
	
	-- Get the "minute"
	set Pos to offset of ":" in MyDate
	set minute to characters 1 thru (Pos - 1) of MyDate as string
	set MyDate to characters (Pos + 1) through end of MyDate as string
	
	--Get "AM or PM"
	set Pos to offset of " " in MyDate
	set suffix to characters (Pos + 1) through end of MyDate as string
	
	return (hour & ":" & minute & " " & suffix) as string
end shortDate
 
Quote:
Originally Posted by Tom Bunch View Post
Well, I surprised myself. This works, but I'm sure there are bugs and limitations. One known one is that it doesn't handle recurring events. iCal just gives you a recurrence rule and lets you figure out when the event will recur (see RFC 2445 and, well, don't look at me...). It will also not remove exceptions should an event be removed from your calendar.

So... regard this as a crude starting point?
Thanks very much, Tom. I tried this, and I'm not getting visible results. Clearly it reads up to the last date in iCal (or rather, the end time of the last entry I've put in that particular calendar, whether or not it's the last date), because I can see that value in the Results window when I comment out the rest of the script. However, nothing appears in the designated OmniPlan resource calendar.

Clearly, something is happening, because if I open the document, run the script, and close the document, I get a Save prompt.

I got it to work once, but I'm not sure how.

Does it work every time for you, Tom? Is there some condition which must be met, like not viewing the calendar in question?

One thing I've discovered in the course of exploring this is that if you have NO time scheduled for a resource, OmniPlan will helpfully fill in with the default schedule. Sometimes. If you remove default scheduling completely, OmniPlan sometimes fills in a standard morning-and-afternoon schedule. Sometimes. And in my test calendar, although I erased all scheduling, on 07/26, the icon for the date in the lower left is yellowed, indicating that something is there. (And there's not something there in the iCal calendar I'm trying to pull from.)

I'm afraid I'm out of my depth, here. I'm sorry. I guess I'll have to wait for the feature and keep working will very approximate estimates.

-Speireag.
 
Well, that's tough to answer from here. It sounds like you modified the script to put in your own resource & calendar names, and that it successfully found both. It should not matter if you're viewing the calendar in question. If you subtract work time from a schedule during an "off" period OmniPlan should make no schedule exception (i.e., no change).

As written (and without specific testing) I would not be surprised if the script mishandles all day events. It doesn't handle recurrent events, as noted. It will happily import events regardless of status (is should probably only import confirmed and maybe tentative event, certainly not cancelled events).

There is this known bug: edit a resource's work schedule. Make an "off hours" exception. Edit the normal work week for the resource and delete all hours. Switch back to the resource's work schedule. If the "off hours" exception was all day, you'll see an exception (yellow date in the calendar) but there will be nothing there. If it was a partial day, it will mysteriously turn into an inverse "on hours" exception. I wonder if you were seeing a variant of that?

If OmniPlan is replacing your empty schedule with a default schedule sometimes, I'd sure like steps to reproduce that. I wonder if the problem is really that you're deselecting the resource and looking at the project schedule without realizing it? This is an area where the interface is a little weak and I'd love to improve it.

So, my successful test of the script using OmniPlan 1.6.2 was very simple. Create a document w/ a resource named "Resource 1". Add a non recurring event to my "Work" calendar during Resource 1's schedule hours. Run the script. Watch the schedule exception appear.

The script does not re-level your project, so assigned tasks will not scoot out of the way of your schedule exceptions until you do so yourself.

Don't know if that helps. I certainly understand if it's more work than you were hoping for!

-Tom
 
Hello, all.

As noted above, I need OmniPlan to look to iCal for my work availability on my home-building project. I simply do not have the time to load in that calendar in two places.

I stopped using OmniPlan for over a year because of that, but I'm trying to come back to it. I could not get Tom's AppleScript to work (thank you again VERY much for trying, Tom).

In the interim, has any other solution surfaced? Does anyone have a script which I could attempt? I am not AppleScript talented, so my ability to modify and troubleshoot one is very limited.

-Speireag.
 
My problem is similar. I'm a one man shop and manages several small projects. One single activity is seldom longer than two days.

I've also got meetings, appointments and a kids, so my availability differs a lot from day to day.

I'd like Omniplan to look at my calendar and deduct all events marked busy from my workday (8 hours/day), so for example monday has 7 available hours, tuesday 4h, wednesday 8h, thursday 5h and so forth.

I want to instantly see if I have four hours to spare next thursday when a client calls, or how my next three weeks is affected by a meeting running over a couple of hours.

Just assuming that I have average 30 available hours a week is waaaay to low-res.
 
Any news on this functionality? Could be great to have!
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Omnifocus iCal Due Reminders Calendar fredday iCal Sync 2 2011-03-22 08:48 PM
Sync tasks with due-dates to iCal-calendar? [See "Replacing Calendar Sync" thread.] tkaufmann iCal Sync 34 2011-02-10 03:25 PM
OF to ICal keeping the context/calendar? amelchi OmniFocus 1 for Mac 3 2010-01-02 01:25 AM
.mac calendar in ical doesn't sync djaneb iCal Sync 1 2007-11-24 12:16 AM


All times are GMT -8. The time now is 01:00 AM.


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