The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniPlan General (http://forums.omnigroup.com/forumdisplay.php?f=37)
-   -   Applescript Help: getting a list of tasks (http://forums.omnigroup.com/showthread.php?t=2521)

tweir 2007-01-03 03:27 PM

Applescript Help: getting a list of tasks
 
I'm have some trouble iterating over all tasks/resources in a project. Could somebody give me a snippet or two?

What I'm trying to do is to keep a bug database & OmniPlan in sync with each other. In order to do this, I need to be able to iterate over the list of project tasks that correspond to the bug tickets in order to update status/effort/estimates.

Thanks,

Tom

Tom Bunch 2007-01-05 03:26 PM

This script does the iteration you're looking for. I'm not really doing anything with the results, so if you run this in Script Editor or something, the result will just be the name of the last resource.

I might imagine that some of your tasks will have a bug ticket number in custom data that you can use to match things up. Is this enough to get you started?

[CODE]tell application "OmniPlan"
tell front document
repeat with MyTask in every task
name of MyTask
duration of MyTask
custom data of MyTask
end repeat
repeat with MyResource in every resource
name of MyResource
end repeat
end tell
end tell[/CODE]

Lizard 2007-01-05 05:50 PM

Tom's right --- IF you've somehow managed to get your hands on an unauthorized pre-beta copy of OmniPlan 1.1. We're hard at work on improving the AppleScript support in version 1.1. There's enough changes coming in this department that I feel obligated to warn you that there's a good chance your 1.0 scripts won't work with 1.1.

However, if you still really want this script for 1.0, it is possible. "every task" in 1.0 only gives you the top-level tasks, so you'll have to recursively ask each task you find for its children also.

Tom Bunch 2007-01-10 02:33 PM

[QUOTE=Lizard]Tom's right --- IF you've somehow managed to get your hands on an unauthorized pre-beta copy of OmniPlan 1.1.[/QUOTE]

I was about to be all sheepish and say something about how "this is why developer's don't speak in public". But actually I tried this script with our released 1.0 v121.1 and it works just fine.

It's true, we are already hard at work improving support, but I'm pretty sure we already have this much. :o

-Tom


All times are GMT -8. The time now is 12:14 AM.

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