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 > Developer > AppleScripting Omni Apps
FAQ Members List Calendar Search Today's Posts Mark Forums Read

AppleScript Project's Resource Filtering Thread Tools Search this Thread Display Modes
Is it possible to filter a project's tasks by resources within AppleScript? I understand to export a project as an iCal you first need to specify a filter; in this instance I'd like to filter by Resource and the resource itself corresponds to the "person" resource type so I can export each person's schedule to an individual iCal file.

I'm having troubles searching online and looking through OmniPlan's AppleScript library to in any way find the method to filter a project via AppleScript.
You might get a more informed response in the OmniPlan Extras or OmniPlan forums, but it's possible that code of the following pattern may be relevant to part of your question

tell application id "com.omnigroup.OmniPlan"
	set oDoc to front document
	set lstFredTasks to my PersonTasks(oDoc, "Fred")
end tell

on PersonTasks(oDoc, strName)
	using terms from application "OmniPlan"
		tell oDoc
			set lstRes to (resources where (resource type is person) and (name is strName))
			if length of lstRes > 0 then
				task of every assignment of first item of lstRes
			end if
		end tell
	end using terms from
end PersonTasks

Last edited by RobTrew; 2010-04-14 at 11:51 AM.. Reason: wrapped code as PersonTasks() function
I've been working with RobTrew's particular piece of code and also experimenting and researching lots of other ideas that I've found within the forum. At one point I had an Applescript that would generate an HTML Full Report, went through and renamed each iCal to the resource's name and then deleted all the other files. However, when testing it with our full studio project file the exporting crashed Omniplan (mind you, this project file has over 30 resources and has tasks that go as far back to 2008) and rendered my Applescript useless (boo hoo).

Another method I attempted was to iterate through each resource, set the "filtered" value to "true" and then export the project as an iCal. The problem that occured with this method was that even though I was setting "filtered" to a boolean, it wouldn't take it and came back with the error:

OmniPlan got an error: [ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key isFilteredOut

I'm about ready to call quits on this! I just haven't the time to invest in it further, especially with currently no proven methods to do this, so I'd like to request some way of being able to export each resource's scheduled tasks as an iCal file and the option to specify the start and end period would be nice too. If the export could also be named what the resource is named, then that would be pretty spiffy too.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Filtering by available tasks with AppleScript DGrady OmniFocus Extras 8 2012-11-20 01:41 PM
Simple Applescript, Create Task, Assign resource, Assign dependency dexterama OmniPlan Extras 2 2012-11-18 12:25 PM
When a project's next action is a calendar event vbdjames Applying OmniFocus 4 2011-11-02 04:34 AM
Modifying project's note via applescript not updated in display: MVC bug? fudster OmniFocus Extras 0 2010-03-01 09:37 AM
Export selected resource in Resource View upriser OmniPlan General 3 2008-03-05 05:25 AM

All times are GMT -8. The time now is 01:30 PM.

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