How can i get a topic's Oid (not the registry GUID)? thanks

krsto e. shared this question 3 hours ago
Discussion Open

Hi,

Using Ctrl+Alt+C, I can copy a topic's link in this format:

Format 1 (MindManager internal link): mj-map:///C:\test.mmap#oid={236FC09B-4CE6-4EE4-AFE4-74759FAAEAC0}

I need to convert this into the following format:

Format 2 (XPointer URL): C:\test.mmap#xpointer(/descendant-or-self::ap:Topic[@OId='m8BvI+ZM5E6v5HR1n6rqwA=='])

Background / Why I need this:

I created a map roll-up linked to a topic, then removed the link. I saved it as a Favourite so it can be reused — the idea being to paste topic links into it to create map roll-ups quickly.

This works well with one exception:

  • Cross-map links (linking to a topic in a different map) work fine.
  • Same-map links (linking to a topic in the same map) are automatically converted by MindManager into a "This Map → Topic" link type, which does not include subtrees.

Workaround (manual): To get subtrees from a same-map topic, I have to manually edit the link, select "URL/File Path" as the link type, and paste the .mmap file path (obtained via Copy as Link from the map's tab).

Request: I'd like a macro that automatically converts Format 1 into Format 2, so this workaround can be done in one step.

Thank you!

Best Answer
photo

not sure indeed by default we obtain bas64 oid instead.

here is the report by GLM 4.7

Title: How to get XPointer Roll-up hyperlinks via macro — Topic.Guid already returns Base64 @OId format!

Body:

Hi everyone,

I was trying to create XPointer hyperlinks for Roll-up topics via macro and discovered something useful that might help others:

The Topic.Guid property already returns the Base64 @OId format directly!

For example, if you run:


Dim t As Topic
Set t = ActiveDocument.Selection.PrimaryTopic
MsgBox t.Guid

You'll get something like: wpg2UkXNkkyMRiwVH/3ZEA== (Base64 format)

This means you can build XPointer Roll-up links directly without any conversion:

Result: C:\Maps\MyMap.mmap#xpointer(/descendant-or-self::ap:Topic[@OId='wpg2UkXNkkyMRiwVH/3ZEA=='])

The API documentation just says Guid "Returns the object's globally-unique identifier" but doesn't mention it's already in the Base64 @OId format needed for XPointer links. This saved me from having to do any GUID-to-Base64 conversion!

Hope this helps someone else working with Roll-up hyperlinks!

Replies (2)

photo
1

not sure indeed by default we obtain bas64 oid instead.

here is the report by GLM 4.7

Title: How to get XPointer Roll-up hyperlinks via macro — Topic.Guid already returns Base64 @OId format!

Body:

Hi everyone,

I was trying to create XPointer hyperlinks for Roll-up topics via macro and discovered something useful that might help others:

The Topic.Guid property already returns the Base64 @OId format directly!

For example, if you run:


Dim t As Topic
Set t = ActiveDocument.Selection.PrimaryTopic
MsgBox t.Guid

You'll get something like: wpg2UkXNkkyMRiwVH/3ZEA== (Base64 format)

This means you can build XPointer Roll-up links directly without any conversion:

Result: C:\Maps\MyMap.mmap#xpointer(/descendant-or-self::ap:Topic[@OId='wpg2UkXNkkyMRiwVH/3ZEA=='])

The API documentation just says Guid "Returns the object's globally-unique identifier" but doesn't mention it's already in the Base64 @OId format needed for XPointer links. This saved me from having to do any GUID-to-Base64 conversion!

Hope this helps someone else working with Roll-up hyperlinks!

photo
1

anyway, i did it.

so now for a roll up map,

i just need to add a map roll up template from my "favourite", and then copy and paste any topic's url to it. if it's same map, the url need go thru the macro.

Leave a Comment
 
Attach a file
You can't vote. Please authorize!