Export to WBS preserving hierarchical task numbering
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 [/code] Worth every penny you paid for it, no doubt :-) |
Thanks!
Works like a charm!
|
Removing WBS package numbers prior to export
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[/CODE] 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 [/CODE] 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 [/CODE] 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 [/CODE] |
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 :-)
|
All times are GMT -8. The time now is 06:36 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.