(* MapToOmniOutliner This AppleScript sample demonstrates how to walk the contents of a Mindjet MindManager map and add the topics from the map to an OmniOutliner outline. For more information on OmniOutliner, please visit the Omnigroup's product web site at: Copyright 2006 Mindjet Corporation. All rights reserved. *) global omniDocument -- holds the OmniOutliner document as it is constructed (* addMMSubtreeToOmni - accepts a topic in a map, and a topic in an outline. This handler adds the children of the map topic as children of the outline topic and then calls itself recursively so that an entire subtree of the map is reflected in the outline. *) on addMMSubtreeToOmni(mmTopic, omniParent) tell application "Mindjet MindManager" -- Enter a loop that adds each subtopic from the map -- into the outline repeat with childTopic in subtopics of mmTopic set topicTitle to (a reference to the title of childTopic) tell application "OmniOutliner" tell omniDocument -- Create the new child in the Omni outline set omniChild to make new child at end of children of omniParent with properties {topic:topicTitle, expanded:true} -- Try to reflect the font settings from the map set font of topic of omniChild to font of topicTitle set size of topic of omniChild to size of topicTitle set color of topic of omniChild to color of topicTitle end tell end tell -- Call this routine again to build the subtree of -- the child we just added to the outline tell me to addMMSubtreeToOmni(childTopic, omniChild) end repeat end tell end addMMSubtreeToOmni (* The main run handler. Here we begin a new omni outliner document and add a root row to it. We then call addMMSubtreeToOmni which does the work of reflecting the map on to the Omni outline. *) tell application "OmniOutliner" activate set omniDocument to make new document end tell tell application "Mindjet MindManager" set centralTopic to central topic of document 1 set topicTitle to a reference to title of centralTopic tell application "OmniOutliner" activate tell omniDocument -- Create a starting row to represent the central topic set omniRoot to the make new row at end of rows of omniDocument set the topic of omniRoot to topicTitle set expanded of omniRoot to true -- Reflect the font settings of the central topic on the -- outline. set font of topic of omniRoot to font of topicTitle set size of topic of omniRoot to size of topicTitle set color of topic of omniRoot to color of topicTitle end tell end tell tell me to addMMSubtreeToOmni(centralTopic, omniRoot) return end tell