The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniGraffle General (http://forums.omnigroup.com/forumdisplay.php?f=10)
-   -   Howto? Importing omnioutliner into OG 5 (http://forums.omnigroup.com/showthread.php?t=30928)

Msburdick 2013-10-14 07:32 PM

Howto? Importing omnioutliner into OG 5
 
importing works great in OG5....

question is:

I have my "hierarchy" in column 1 and that expands perfectly. I have descriptive text and info in several columns after 1. How do I get those descriptive columns "pulled" in to each level in column 1?

Example

C1 = food c2 daily food c3 total daily allowed
c1 = breakfast c2 mornings only c3 500 cal (sub group entries follows)
c1 = lunch c2 noon time c3 700 cal (sub group entries follows)
c1 = dinner c2 after 5pm c3 1000 cal (sub group entries follows)

if I import with org chart I only see "food" box and "breakfast" "lunch" "dinner" child boxes with out the descriptions in C2 and C3 inside each box.

Thanks in advance for your insights....

Mark

RobTrew 2013-10-14 11:14 PM

[QUOTE=Msburdick;127962]importing works great in OG5....

I have descriptive text and info in several columns after 1. How do I get those descriptive columns "pulled" in to each level in column 1?[/QUOTE]

It depends on what you want to do with the [I]column name + value[/I] pairs.

Here is a script which makes them into key/value custom data pairs (Inspectors > Properties > Note).

(Exports any rows currently selected in OO3, with their whole subtrees, to OG5)

You could modify the script to append the column names and values to the shape text, or to create additional child shapes with these texts.

[CODE]property pstrTemplate : "Standard"
property plngWide : 80
property plngDown : 80

-- VER .003 EXPORTS the values of additional columns as custom data key/value pairs (Inspectors > Properties > Note)

on run
-- SELECT ONE OR MORE PARENT NODES IN OO3,
-- TO EXPORT THEM, WITH THEIR ENTIRE SUBTREE(S) TO OMNIGRAFFLE PRO 5
GraphNodes(SeldNodes())
end run

on GraphNodes(lstNodes)
if lstNodes ≠ {} then
tell application id "OGfl"

-- USE TEMPLATE NAMED IN pstrTemplate PROPERTY (ABOVE), IF IT EXISTS
try
set oDoc to make new document with properties {template:pstrTemplate}
on error
set oDoc to make new document
end try

tell oDoc
tell front canvas
set automatic layout of its layout info to false
if (count of graphics) > 0 then delete graphics
set oLayer to front layer
tell oLayer
--set visible to false
repeat with oNode in lstNodes
set {strName, lstKeyValue, lstChiln} to oNode
set oShape to make new shape with properties {text:strName, size:{plngWide, plngDown}}
repeat with lstTag in lstKeyValue
set {strKey, strValue} to lstTag
if strValue ≠ "" then
set value of user data item strKey of oShape to strValue
end repeat
if lstChiln ≠ {} then my DrawTree(oLayer, oShape, lstChiln)
end repeat
--set visible to true
end tell
set automatic layout of its layout info to true
layout
end tell
end tell
activate
end tell
end if
end GraphNodes

on DrawTree(oLayer, oShape, lstChiln)
set lngChiln to count of lstChiln
if lngChiln < 1 then return
tell application id "OGfl"
tell oLayer
repeat with i from 1 to lngChiln
set {strName, lstKeyValue, lstSub} to item i of lstChiln
set oChildShape to (make new shape with properties {text:strName, size:{plngWide, plngDown}})
tell oChildShape
set blnFirst to true
repeat with lstTag in lstKeyValue
set {strKey, strValue} to lstTag
if strValue ≠ "" then
strValue
set value of user data item strKey to strValue
if strKey begins with "Path" then
if blnFirst then
set tag to strKey
else
set strTag to tag as string
if strTag ≠ "" then
set tag to strTag & "," & strKey
else
set tag to strKey
end if
end if
end if
end if
set blnFirst to false
end repeat
end tell
-- tell (make new line) to set {source, destination} to {oShape, oChildShape}
connect oShape to oChildShape

if lstSub ≠ {} then my DrawTree(oLayer, oChildShape, lstSub)
end repeat
end tell
end tell
end DrawTree

on SeldNodes()
tell application id "OOut"
tell front document
-- FIND THE OUTERMOST LEVEL OF ANY SELECTED NODES
set lstLevel to level of selected rows
set lngRows to count of lstLevel
if lngRows < 1 then return {}
set lngTop to first item of lstLevel
if lngTop > 1 then
repeat with i from 2 to lngRows
set lngLevel to item i of lstLevel
if lngLevel < lngTop then set lngTop to lngLevel
end repeat
end if
-- IDENTIFY ANY ADDITIONAL COLUMNS FOR EXPORT
set {idTopic, idNote} to {id of topic column, id of note column}
set refCols to a reference to (columns where (its id is not idTopic) and (its id is not idNote))
set {lstID, lstName} to {id, name} of refCols
set lngCols to length of lstID

-- START WITH THE ROWS AT THE OUTERMOST LEVEL
set lstRows to (selected rows where level = lngTop)
repeat with i from 1 to (count of lstRows)
set item i of lstRows to my VisibleTree(item i of lstRows, lngCols, lstID, lstName)
end repeat
lstRows
end tell
end tell
end SeldNodes

on VisibleTree(oRow, lngCols, lstID, lstName)
tell application id "OOut"
set lstChiln to (children of oRow where visible = true)
repeat with i from 1 to count of lstChiln
set item i of lstChiln to my VisibleTree(item i of lstChiln, lngCols, lstID, lstName)
end repeat

-- GATHER ANY KEYVALUE PAIRS FROM ADDITIONAL COLUMNS FOR OG TAGS
set lstKeyValue to {}
repeat with i from 1 to lngCols
set varValue to (value of cell id (item i of lstID) of oRow)
set strKey to item i of lstName
--if strKey begins with "path" then
if varValue is not missing value then
set varValue to varValue as string
else
set varValue to ""
end if
set end of lstKeyValue to {strKey, varValue as string}
--end if
end repeat
return {topic of oRow, lstKeyValue, lstChiln}
end tell
end VisibleTree
[/CODE]

Msburdick 2013-10-15 06:23 AM

Wonderful! Thank you very much!.

Mark


All times are GMT -8. The time now is 03:04 AM.

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