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

 
Join Projects class Otco error Thread Tools Search this Thread Display Modes
I'm using the OmniPlan trial (tried 1.5.0 / 1.5.1 rc1) and wanted to use the Join Projects script to merge a couple of my schedules.

I've tried joining small schedules (less than 10 tasks/subtasks each), and purely test schedules of 3-4 tasks each, but get the same error:
The script 'Join Projects' could not complete.

AppleScript reported the following error:
OmniPlan got an error: Can't get <<class Otco>> of item 1 of every child task of project of document id "91DC1FFE-...".
Any ideas? I'm considering purchasing OmniPlan if this works out.

Thanks a bunch.
 
You can fix the script by opening it in Script Editor, and changing the two places where "<<class Otco>>" occurs to "completed".

However, this script was mostly created as a temporary workaround until 1.5 was released. Now you can accomplish essentially the same thing just by dragging tasks from one project to another. (In 1.1, that would only copy the tasks, but now it also brings their resource assignments.)
 
Thanks this worked.

What I'd ideally want to do is automatically take a folder of individual schedules and combine them into one master schedule, then use filters to produce a schedule specific to each resource. Dragging and dropping is too much work for doing this whenever an individual schedule updates or for working with many schedules.

Is there a way to easily change this script so that it loops through a whole folder, instead of joining a single file?

Thanks!
 
That should be fairly straightforward.

On line 400, change "choose file" to "choose folder"
Then wrap everything from lines 405 to 472 in a repeat block something like
Code:
repeat with thisFile in items of sourceInfo whose kind is "OmniPlan"
and then change all occurrences of sourceInfo inside that block to thisFile
 
I tried this, but got an error on the new repeat line:
The variable sourceInfo is not defined.
 
Just in case it helps, here's what the lines in question look like after modification:

Code:
	if my onlyShowOmniPlanFilesInOpenDialog then
		set sourceAlias to choose file with prompt "Source project to import contents from:" of type {"com.omnigroup.omniplan.planfile"} without invisibles
	else
		set sourceAlias to choose folder with prompt "Source project to import contents from:" without invisibles
	end if
	
	repeat with thisFile in (items of sourceInfo whose kind is "OmniPlan")
		-- sneaky trick to prevent quirks that occur when two OmniPlan files have the same uuid. Generate a new file using the original as a template will force a new unique id. 
		set thisFile to info for sourceAlias
		if kind of thisFile is "OmniPlan" then
			set t to POSIX path of sourceAlias
			set sourceDoc to make new document with properties {template:t}
			set sourceName to name of thisFile
... and I ended the repeat before the end tell on the last line of the script.

Thanks for all the help.
 
Code:
set thisFile to info for sourceAlias
should be before the repeat and changed back to

Code:
set sourceInfo to info for sourceAlias
 
I made the changes and got this error:
The script 'Join Projects' could not complete.
AppleScript reported the following error:
Can’t get {"micro schedules", date "Monday, April 7, 2008 12:36:27 PM", date "Monday, April 7, 2008 12:36:38 PM", 82593, true, false, false, true, false, missing value, "micro schedules", alias "Test Leopard Server Standard:System:Library:CoreServices:Finder.app:", "Folder", {0, 0, 0, 0}, "", ""} whose «class kind» of it = "OmniPlan".
 
This is what I get for not trying out a solution before telling it to you.

I'm having a bit of a fight with Finder's applescript interface trying to fix it the way I told you. So here's a simpler, yet slightly less convenient way. You'll have to select all the projects in the choose dialog, but it means it works.
Attached Files
File Type: zip Mod Join Projects.zip (35.3 KB, 756 views)
 
Thanks for the script. It did the trick. Great! Let's see what OmniPlan 2 comes up with...
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Class Diagram by omnigraffle ankitverma05 OmniGraffle General 2 2012-10-16 06:04 PM
Script error when re-arranging projects iNik OmniFocus Extras 0 2008-10-13 11:25 AM
Import Java class structure magir OmniGraffle Extras 1 2007-04-26 04:11 AM


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


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