Is it possible to preserve the task numbering during WBS export either using standard export or custom AppleScript. Any help is appreciated!
Thanks,
Alex
Thanks,
Alex
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!
|
|
FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
Export to WBS preserving hierarchical task numbering | Thread Tools | Search this Thread | Display Modes |
Member
2013-01-28, 10:38 PM
Is it possible to preserve the task numbering during WBS export either using standard export or custom AppleScript. Any help is appreciated!
Thanks, Alex
Post 1
|
Member
2013-01-28, 11:25 PM
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
Post 2
|
Member
2013-01-29, 01:09 AM
Works like a charm!
Post 3
|
Member
2013-01-29, 11:55 PM
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:
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:
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
Post 4
|
Member
2013-01-30, 12:46 AM
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
Post 5
|
Member
2013-01-30, 01:53 AM
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 :-)
Post 6
|
Thread Tools | Search this Thread |
Display Modes | |
|
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 |