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 Today's Posts

 
Export to WBS preserving hierarchical task numbering Thread Tools Search this Thread Display Modes
Is it possible to preserve the task numbering during WBS export either using standard export or custom AppleScript. Any help is appreciated!

Thanks,

Alex
 
Make a duplicate copy of your document, then run the following trivial Applescript against the duplicate before doing your export.

Code:
tell application "OmniPlan"
	tell front document
		repeat with MyTask in tasks
			tell MyTask
				set name to outline number & ") " & name
			end tell
		end repeat
	end tell
end tell
Worth every penny you paid for it, no doubt :-)
 
Works like a charm!
 
I tried to write a similar script, but which will remove the numbers added in the previously. It works with the test string, but when I run it against the OmniPlan document it generates the error message:

Code:
error "OmniPlan got an error: 
Can’t get every text item of name of item 1 of every task of document 1." number -1728 from every text item of name of item 1 of every task of document 1
Here's the script:

Code:
tell application "OmniPlan"
	tell front document
		repeat with MyTask in tasks
			tell MyTask
				set tid to AppleScript's text item delimiters
				set AppleScript's text item delimiters to ") "
				if (count name's text items) > 1 then set name to name's text items
				set name to items 2 thru -1 of name
				set AppleScript's text item delimiters to ") "
				set name to name as string
				set AppleScript's text item delimiters to tid
			end tell
		end repeat
	end tell
end tell
Here's the version which uses test string instead of OmniPlan document:

Code:
set t to "1.2.3.4) sample containing bracket(s) and other text"

set tid to AppleScript's text item delimiters
set AppleScript's text item delimiters to ") "
if (count t's text items) > 1 then set t to t's text items
set t to items 2 thru -1 of t
set AppleScript's text item delimiters to ") "
set t to t as string
set AppleScript's text item delimiters to tid
t
Any ideas what's wrong with the first script?
 
Got it working: this version removes the WBS numbers e.g. if you need to renumber the tasks or after exporting to WBS.

Code:
tell application "OmniPlan"
	tell front document
		repeat with MyTask in tasks
			tell MyTask
				set tid to AppleScript's text item delimiters
				set AppleScript's text item delimiters to ") "
				set t to name as string
				if (count t's text items) > 1 then
					set t to t's text items
					set t to items 2 thru -1 of t
					set name to t as string
				end if
				set AppleScript's text item delimiters to tid
			end tell
		end repeat
	end tell
end tell
 
I certainly could have written such a script for you, but I didn't. The reason I suggested you run my script against a duplicate copy of your document is that if you are publishing changes, your round trip caused 2n changes to be made, where n is the number of tasks in the document. I don't think you want to have that going on unless you are interested in stress-testing the application with your data :-)
 
 




Similar Threads
Thread Thread Starter Forum Replies Last Post
hierarchical row numbering - inheritance ahdavidson OmniOutliner 3 for Mac 2 2008-12-11 03:28 PM
Dynamic HTML Export and Numbering Style wildgunman OmniOutliner 3 for Mac 0 2008-02-18 01:05 PM
Task Numbering blepine OmniPlan General 2 2007-10-09 05:25 PM
Hierarchical task inheritance, etc. Frosty Crunch OmniFocus 1 for Mac 5 2007-10-06 04:03 PM
Hierarchical numbering vs flat numbering and sorting womich OmniOutliner 3 for Mac 1 2007-09-06 03:28 PM


All times are GMT -8. The time now is 03:11 PM.


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