PDA

View Full Version : 1.1 Beta 1 - Applescript Questions


alansg
2007-02-01, 06:55 AM
Is this the appropriate place for questions related to Applescript and the 1.1 beta?

First: I'm very pleased to see the improved scriptability of resource calendars. I've found the new subtract/add work time commands. Thank you!

I've successfully scripted schedule "exceptions" [subtract work time] but I'm not able to delete them via the standard delete command. There appears to be no object reference returned from the subtract work time command that can be used later to delete the exception. [If there was, I'd be storing it externally for later use, though I can get by without it.]

I can use a whose clause to locate the calendar day schedule for a specific date, but it doesn't appear the result can be used as the reference in the delete command.

I tried using add work time to "negate" the time period carved out by subtract. My work time was added, but I didn't like the looks of it in the calendar view in the user interface.

I'm not sure that's the right way to achieve my goal anyway. This issue can quite likely be my misunderstanding of how calendars are modeled in OmniPlan. It doesn't appear that there's a way to target these exceptions for delete.

What I'd like to be able to do is "clear" any or all of the exceptions created by the subtract work time command for any given day, and having that day "revert" back to the "default" calendar.

Is there a way to do that?

TIA.

Lizard
2007-02-01, 09:40 AM
That part of the AppleScript library hasn't really been tested yet, either for functionality or coherency. It's a bit of a work-in-progress, you know? I'll get back to you on that in a day or so.

alansg
2007-02-02, 03:32 PM
I tried using add work time to "negate" the time period carved out by subtract. My work time was added, but I didn't like the looks of it in the calendar view in the user interface.

Now that was less than helpful, wasn't it? And, it turns out to be a non-issue.

Using "add work time" can definitely remove a time period set by "subtract work time". If the result becomes the default schedule, the user interface appears to be updated to accurately reflect that, and what I expected.

What I saw in the user interface that "concerned" me was merely the text label of the default time period bleeding through the transparency of the "overlaid" time period added there by "add work time".

The inability to delete (by design, perhaps) remains an open question.

Alan

Lizard
2007-03-10, 08:24 AM
We've rearranged the scripting library a bit, in part due to your feedback. Please let us know if it's working better for you.

alansg
2007-03-10, 09:06 AM
Yes, thank you. I'm pretty sure beta 3 solved these problems. Beta 4 is no exception.

I have a script which applies an iCal calendar to a resource calendar. The script "wipes clean" any non-working objects from the resource calendar from the current time to the end of the project. Events from iCal from the current time until the end of the project are then applied to the resource calendar.

OmniPlan responds appropriately, often showing a result of over-utilization or missed end-dates. Re-leveling works as expected.

There's a slight flaw in the method in that I don't get events past the current project end_date. After re-leveling, that date often changes. It won't be hard to fix that in my script, though.

I store the name of the iCal calendar to fetch as a key in the Custom Data for the resource. That lets me use different iCal calendars for different resources.

This definitely meets my needs for what I'm trying to accomplish. Good job Omni Group!