MindManager Macro - add text to all topics
Discussion Open
Hello,
I am trying to create a macro in MindManager 25 (64-bit) using WinWrap Basic COM mode ('#Language "WWB-COM"). The goal is to add text (it is project ID) recursively to all topics starting from the Central Topic.
Here is the minimal code I am using:
'#Language "WWB-COM"
Sub Main()
Dim appendText
appendText = " - ADDED"
AddTextRecursive ActiveMap.CentralTopic, appendText
End Sub
Sub AddTextRecursive(topic, appendText)
Dim subT
If InStr(topic.Text, appendText) = 0 Then
topic.Text = topic.Text & appendText
End If
For Each subT In topic.SubTopics
AddTextRecursive subT, appendText
Next
End Sub
When I run this macro, I get the error:“Expecting a valid data type (Eg. integer)”
…exactly at the line:
AddTextRecursive ActiveMap.CentralTopic, appendTextI have confirmed:
- The macro engine is set to '#Language "WWB-COM"
- I tried removing Set and Call
- I also tried iterating directly with For Each t In ActiveMap.CentralTopic.SubTopics and get the same error
It seems that in MindManager 25 64-bit, passing ActiveMap.CentralTopic as a parameter to a Sub fails.
Questions:
- Is there a known limitation or bug in MindManager 25 COM scripting that prevents passing CentralTopic as a parameter?
- What is the correct way to recursively iterate all topics starting from the Central Topic using WinWrap Basic COM?
- Are there recommended workarounds to update all topic text via macro in MindManager 25 64-bit?
Thank you very much for your guidance!
1. "Topic" is already a keyword in the MindManager namespace, so try to avoid using existing keywords as variable names.
2. Declare the variable type when declaring the parameters for functions or subs, e.g.
Sub AddTextRecursive(ByVal m_Topic as Topic, ByVal appendText as string)
1. "Topic" is already a keyword in the MindManager namespace, so try to avoid using existing keywords as variable names.
2. Declare the variable type when declaring the parameters for functions or subs, e.g.
Sub AddTextRecursive(ByVal m_Topic as Topic, ByVal appendText as string)
i think the OP could use LLMs first, if fail, turn to human specialist. this save everyone TIME.
previously web bots dont give good result.
now, LLMs work with IDEs. i mainly use cursor (past tense) and now vscode + claude code cli (support UNC path well) or GUI sidebar (still work on UNC path but ur vscode 's cwd cant be UNC path).
the good things is, i grabbed the MM20 api as .html (use whatever site mirror prog you prefer, an foss one is httptrack?).
then use pandoc to turn .html into .md that LLMs read well.
and boom, MM20 api become the LLMs' mother tongue.
ps: but in some senarios, a huamn expect could solve what the above cant solve.
so it's not a replacement. that's too far. rather it is making layman, a "0" -> junior.
i think the OP could use LLMs first, if fail, turn to human specialist. this save everyone TIME.
previously web bots dont give good result.
now, LLMs work with IDEs. i mainly use cursor (past tense) and now vscode + claude code cli (support UNC path well) or GUI sidebar (still work on UNC path but ur vscode 's cwd cant be UNC path).
the good things is, i grabbed the MM20 api as .html (use whatever site mirror prog you prefer, an foss one is httptrack?).
then use pandoc to turn .html into .md that LLMs read well.
and boom, MM20 api become the LLMs' mother tongue.
ps: but in some senarios, a huamn expect could solve what the above cant solve.
so it's not a replacement. that's too far. rather it is making layman, a "0" -> junior.
---