Archive for the 'Mindjet MindManager' Category
MindjetのMind Mapソフトウェア「MindManager」のバージョン9 Mac版が発表されました。
iPhone/iPad版も登場し、MindMapソフトウェアの決定版である本ソフト、お試し版をダウンロードして確認してみたら、AppleScript用語辞書も健在。AppleScript的にはv8と何ら変更点はないのですが、iWork/MS-Officeへのデータ書き出し機能が強化され、Windows版との機能差が少なくなった点が新機軸。
ただ…………やはり、本ソフトの問題点はあまりに高いその価格。機能を考えると3.5万円は高いと思います。それだけ出せばFileMaker Pro v11が買えそうな値段です。
Posted in アプリケーション操作(app control), Mindjet MindManager, 10.6対応, news | No Comments »
選択したフォルダ以下のディレクトリ構造をMindjet MindManager上にプロットするAppleScriptです。
フォルダのみに着目し、ファイルは無視します。かーーなり適当ですが、再帰で処理しています。
Finder上でFolderにつけたラベルの色をMindMap上に再現します。
Betaが登場したMindjet MindManager 8 for Mac上でも動作確認しています。MindManagerのAppleScriptの情報源は、Googleで検索してこのBlogが最初に出てくる程度で、あまりまとまったものが存在していないといった印象がありますが、AppleScript系の機能が足りないといったことはなく、(私は)不満なく使えています。
Finder上でつけたラベルが……

MindMap上に反映されます。

2010年初頭にリリースされるというMindjet MindManager 8では、MindMapをFlash形式で書き出すことができるようになっており、「AppleScriptでMindMapを作成してFlashとして書き出してサイトにアップロードしてURLをメールでお知らせする」といったフローも簡単に作れそうで楽しみです。
→ マインドマップのFlash書き出し例
| スクリプト名:Folder構造をMindMapに v1 |
–Finder上のラベルの色をMindjet MindManager上で再現するためのリスト property labelColor : {“”, {65535, 32896, 0}, {65535, 40756, 42034}, {65535, 65535, 0}, {26214, 65535, 65535}, {48464, 44388, 65535}, {0, 65535, 0}, {50489, 50489, 50489}} global curTopicID
set origFol to choose folder tell application “Finder” set folName to name of origFol end tell
–新規ドキュメントを作成 tell application “Mindjet MindManager” set aDoc to make new document set rootTopicID to the id of central topic of document 1 tell document 1 tell topic id rootTopicID set title to folName end tell end tell set curTopicID to rootTopicID end tell
–指定フォルダ内の第1階層を処理 tell application “Finder” tell folder origFol set folList to every folder if folList is not equal to {} then execFolder(folList, rootTopicID) of me end if (* set fileList to every file if fileList is not equal to {} then execFile(fileList) of me end if *) end tell end tell
–指定フォルダ内のフォルダを処理 on execFolder(aFol, aTopicID) repeat with i in aFol tell application “Finder” set j to i as alias tell folder j set aName to name set aLabel to label index set aLabel to item (aLabel + 1) of labelColor set retID to addResultMainNode(aTopicID, aName as string, “”, aLabel, false) of me set folList to every folder execFolder(folList, retID) of me end tell end tell end repeat end execFolder
(* –指定フォルダ内のファイルを処理 on execFile(aFol) end execFile *)
–IDで指定したノードの下に子ノードを作成する on addResultMainNode(topicID, aTitle, aBody, aColor, aBoundaryF) tell application “Mindjet MindManager” – 指定のトピック名称で新規トピックを作成 tell document 1 set resTopic to make new subtopic for topic id topicID with properties {title:aTitle} set notes of resTopic to aBody –囲みをつけるかどうか if aBoundaryF = true then make new boundary for resTopic end if –指定がある場合にはfill colorを変更 if aColor is not equal to “” then set fill color of resTopic to aColor end if end tell return id of resTopic –作成したトピックのIDを返す end tell end addResultMainNode
|
|
▼新規書類に ▼カーソル位置に ▼ドキュメント末尾に
|
Posted in アプリケーション操作(app control), 10.5対応, Mindjet MindManager, 10.6対応, 10.4対応 | 1 Comment »
Mindjet MindManager上に展開したマインドマップを、選択中のトピック以下を対象に、いい感じにトピックのレベルを反映してCSV書き出しするAppleScriptです。

リスト上でトピックの配置を行い、Excelのワークシート上に……そのまま持って行くのは、不可能ではないにせよかったるい(r1c1形式とA1形式の変換サブルーチン(しかも巨大)を投入する必要がある)ため、以前にリストをCSV書き出しするサブルーチンを作ってあったので、CSV書き出ししておくことにしました。

書き出したCSVのファイルをExcelでオープンすれば、めんどくさい処理なしにExcelにマインドマップの内容を渡せます。
いい感じでマインドマップ上にアイデアを書き込んでいたところに「そのままだと分りづらいからExcelの表にして」などと言われ、一気にテンションが落ち……ないよう作ってみたものです。
風呂上がりにテレビを見ながら、いいかげんに作ったので……a reference toによる高速化を試みているものの、ろくに高速化されていなかったりしますが、目くじらを立てるほど遅くないため放っておきました。
| スクリプト名:Mindjet MindManager上のデータをリストに展開してCSV書き出し |
global gList, gList_r, levelList
set gList to {} set gList_r to a reference to gList set levelList to {}
tell application “Mindjet MindManager” tell document 1 set aSel to selection end tell set aaSel to first item of aSel addMMSubtreeToGlobalVal(aaSel) of me end tell
–行(row)の最大値、列の最大値(levelList)を取得する set rowNum to length of gList_r set colMax to maximumFromList(levelList) of me
–カラのリストを作成する set blankList to makeBlankList(rowNum, colMax, “”) of me
–リストを作成する set tmpCol to 1 set tmpRow to 1
set prevCol to 0 set prevRow to 0
set prevLevel to 0
repeat with i in gList_r set {aTitle, aLevel} to i if aLevel < prevCol then set tmpRow to tmpRow + 1 else if aLevel = prevCol then set tmpRow to tmpRow + 1 else – end if –set item tmpRow of item aLevel of blankList to aTitle set item aLevel of item tmpRow of blankList to aTitle set prevCol to aLevel set prevRow to tmpRow end repeat
set aNewFile to choose file name saveAsCSV(blankList, aNewFile) of me
–指定の大きさでカラのリストを作成する on makeBlankList(rowMax, colMax, anItem) set allData to {} repeat rowMax times set aRow to {} repeat colMax times set the end of aRow to anItem end repeat set the end of allData to aRow end repeat return allData end makeBlankList
–Mindjet MindManager上のトピックを渡すと、その子トピックの情報を収集して、サブトピックを再帰で取得 –結果はGlobal変数(gList)に追記する –別のサブルーチンを書き換えてそのままの名前で使ってしまった on addMMSubtreeToGlobalVal(mmTopic) tell application “Mindjet MindManager” repeat with childTopic in subtopics of mmTopic –指定トピック下の子トピックを取得するのに、この書き方しかMindjet MMが受け付けてくれない set topicTitle to (a reference to the title of childTopic) set aLevel to level of childTopic set aTitle to title of childTopic set the end of gList_r to {aTitle, aLevel} set the end of levelList to aLevel addMMSubtreeToGlobalVal(childTopic) of me end repeat end tell end addMMSubtreeToGlobalVal
–最大値を取得する on maximumFromList(nList) script o property NL : nList end script set max to item 1 of o’s NL repeat with i from 2 to (count nList) set n to item i of o’s NL if n > max then set max to n end repeat return max end maximumFromList
–CSV書き出し –ただし、データ内にダブルクォートが入っていた場合に備えてのサニタイズ処理は行っていない on saveAsCSV(aList, aPath) set crlfChar to (ASCII character 13) & (ASCII character 10) set LF to (ASCII character 10) set wholeText to “” repeat with i in aList set aLineText to “” set curDelim to AppleScript’s text item delimiters set AppleScript’s text item delimiters to “\”,\”" set aLineList to i as text set AppleScript’s text item delimiters to curDelim set aLineText to repChar(aLineList, return, “”) of me –データの途中に改行が入っていた場合には削除する set aLineText to repChar(aLineText, LF, “”) of me –データの途中に改行が入っていた場合には削除する set wholeText to wholeText & “\”" & aLineText & “\”" & crlfChar –行ターミネータはCR+LF end repeat if (aPath as string) does not end with “.csv” then set bPath to aPath & “.csv” as Unicode text else set bPath to aPath as Unicode text end if write_to_file(wholeText, bPath, false) of me end saveAsCSV
–ファイルの追記ルーチン「write_to_file」 –追記データ、追記対象ファイル、boolean(trueで追記) on write_to_file(this_data, target_file, append_data) try set the target_file to the target_file as text set the open_target_file to open for access file target_file with write permission if append_data is false then set eof of the open_target_file to 0 write this_data to the open_target_file starting at eof close access the open_target_file return true on error error_message try close access file target_file end try return error_message end try end write_to_file
–文字置換 on repChar(origText, targChar, repChar) set origText to origText as string set targChar to targChar as string set repChar to repChar as string set curDelim to AppleScript’s text item delimiters set AppleScript’s text item delimiters to targChar set tmpList to text items of origText set AppleScript’s text item delimiters to repChar set retText to tmpList as string set AppleScript’s text item delimiters to curDelim return retText end repChar |
|
▼新規書類に ▼カーソル位置に ▼ドキュメント末尾に
|
Posted in リスト処理(list), アプリケーション操作(app control), 10.5対応, Mindjet MindManager, 10.6対応, 10.4対応 | No Comments »
Mindjet MindManagerで、選択中のトピックに対して境界線を付加するAppleScriptです。もちろん、選択中のトピックなどというヌルい用途のために作成したのではなく、指定のトピックに対して自由に境界線を付加するAppleScriptを作成するための試作品です。
(more…)
Posted in アプリケーション操作(app control), 10.5対応, Mindjet MindManager | No Comments »
Mindjet MindManagerで、ルートトピック(中央のトピック)「以外」をすべて取得するというサンプルです。
(more…)
Posted in アプリケーション操作(app control), 10.5対応, Mindjet MindManager | No Comments »
Mindjet MindManagerで、ルートトピックを選択状態にします。Mail.appからメールのスレッドを取得してメールのやりとりをMindManager上にマインドマップでビジュアル化するAppleScriptを作るときに使ったものです(正確にいえば、その部分の処理は必要なかったので没になってしまいましたが)。
マインドマップで図示したあとで、ルートトピックを選択状態にして各ノードに付加したノード(メール本文が入っている)をウィンドウ下部に表示するよう、GUI Scriptingをまじえつつ処理を書いてみました。うんざりするほどメールの本数が多い場合でも、メールの流れを視覚化できるので、非常に有効です。あまりに有用性が高いので、単体でツールとしてリリースするかもしれません>マインドマップでメールフローを図示するAppleScript
| スクリプト名:MindManagerで、ルートトピックを選択状態にする |
–MindManagerで、ルートトピックを選択状態にする tell application “Mindjet MindManager“ if document 1 exists then set rootTopic to the id of central topic of document 1 select {topic id rootTopic of document 1} end if end tell
|
|
▼新規書類に ▼カーソル位置に ▼ドキュメント末尾に
|
Posted in アプリケーション操作(app control), 10.5対応, Mindjet MindManager | No Comments »