BUG: Macro to insert URL image in Notes is not correct

Pieter_van_der_Hijden shared this question 50 days ago
Discussion Open

Via Windows GUI, I can insert an image in a topic Note without problems, both an image from a local file and an online image via its URL.

Trying to insert an image in a topic Note via a macro goes well if I use a local file. It works strange if I use a URL.

What did I do:

  1. I created a macro to insert an image by URL in the selected topic.
  2. Wheb I run the macro, the result is an empty frame is inserted in the Note.
  3. The empty frame has a popup menu. The menu actions are as follows:
  4. save image: error message: cannot find this file (and it lists the correct URL)
  5. format image: shows link to source image (that same URL)
  6. refresh image: cannot find this file
  7. reset image size: cannot find this file
  8. I exported the mindmap to MS Word: now the picture is present!
  9. I exported the mindmap to webpages: now the picture is present as well (beit as GIF and not as PNG)
    My conclusion: The macro for adding a web image to a topic note does not render the image, although it "knows" the correct URL as a reference to the source.

Please, advice.

Replies (3)

photo
1

Hello Pieter

  1. What is the process you are using to insert an image by URL using the UI?
  2. The XHTML generated by your macro does not appear to be a well-formed document. Maybe MindManager tolerates this, if a local image works.
  3. Have you tried using Topic.Notes.Commit after replacing its XHTML? This might render the image.

photo
1

Hi Nick,

Thank you for your reaction!

The reason for my efforts is that I create mindmaps with many many topics and would like to add pictures to these topic's notes as well. I want to avoid my mm simply to become too big for available memory, or its published HTML5 equivalent become too big for downloading especially where bandwith is limited. IMHO Filling my notes with pictures that are not really embedded could help.

Regarding your comments:

  1. The UI process: goto Note pane; click Image; fill URL in FileName field; press Insert. See screenshot 1.8fc21289b9dd1d5388eca82b5031db44e202c09f5997ed6a79f152875bdf00f2
    In fact, I can even click on either Insert or "Insert and Link". In both cases, the image becomes visible in the Note. However, in the latter case, the Format Image dialogue box shows me a link in AppData/Local/Microsoft... to the picture and tells me "Image is not embedded and saved in document".
    9090b8292cecdb4cdfc626d1384903c25f414eadff8b7127e9d6efc1d37bfbd6
  2. This is my XHTML piece of code. IMHO it is well formatted:
    <p>Begin</p><img src='https://sofosconsultancy.wordpress.com/wp-content/uploads/2025/08/density-world-geo-wo.gif' width='300' /><p>End</p>
  3. I just added topic.Notes.Commit() at the end of the macro, but the picture is still not visible.

All the best,

Pieter van der Hijden

photo
2

Hello Pieter

Thank you for the clarification. The XHTML for an image embedded this way contains a complete document definition and also refers to a protocol "mmnotes". It does not contain the original image URL.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><p><span><img src="mmnotes://0.png" align="bottom" width="576" height="324" border="0" alt="graphic"/></span></p></html>

The mmnotes protocol is resolved privately by MindManager, and looks up a cached copy of the image in the document XML:

d086be76660b226b4e6c8c8f6ed87e327844e58cb280311d8111bab1422abd68

This mechanism is not exposed in the API so I don't think this cache can be directly accessed.

However there is a method in the API for inserting an image into the topic notes from a local file: Notes.InsertImage(path). It seems that this method does not accept a web URL, but maybe your macro could download a copy of the image and then insert it into the notes using the locally cached path. This would avoid inflation of MindManager map sizes.

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