MindManager Macro - add text to all topics

Vincenzo shared this question 2 months ago
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, appendText
I 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:

  1. Is there a known limitation or bug in MindManager 25 COM scripting that prevents passing CentralTopic as a parameter?
  2. What is the correct way to recursively iterate all topics starting from the Central Topic using WinWrap Basic COM?
  3. Are there recommended workarounds to update all topic text via macro in MindManager 25 64-bit?

Thank you very much for your guidance!

Replies (2)

photo
1

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)

photo
1

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.

photo
1

btw, claude code could also work with deepseek API. i found the result is 99.99% working and good,

price is 1/20.

if you are untrust to chinese, there are deepseek api providers in US.


but after snowden's event,

i'll say, if you are outside china, you are ok to be monitored by china govt', as they cant reach you.


in contrast, if you are inside china, you are ok to be monitored by US gov't, they cant reach you too.

photo
Leave a Comment
 
Attach a file