-
Hello! I am long-time user of freeplane for study in medical school, with almost no coding background. I've managed to write a few very basic scripts myself but need some help on this particular issue. Basic Goal N1 has a global hyperlink to N2. From N1, I would like to be able to, in one click / with a script, copy N2 and paste it (and any children) as a child of N1 - let's call this new copy N2x. What I have tried: I tried to write a script myself using appendBranch but I really don't have anywhere near enough experience to do something this complex - I know almost nothing about java or groovy! I would really appreciate if someone could help me write a script to accomplish this goal - effectively a "paste linked node from another map" feature. I would execute the script on N1 in Map A, it would follow the link in N1 to N2 in Map B, and then copy and paste [nB without deleting the original N2] it as a child of N1 in Map A. Bonus Goal Bonus Bonus Goal My apologies if this kind of thing has been addressed in the past, but I searched this discussion thread and the old one at sourceforge, as well as browsing the API to see if I could figure out a simple way to do it, but I couldn't find an answer. Thank you in advance to anyone who reads this and can give any advice or help! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 12 replies
-
I will try to create the script, tomorrow, but what immediately comes to my mind is: have you considered using one big single map? I have difficulty in visualizing any advantages of using multiple maps. This setup that you want is much easier when done inside the same map. |
Beta Was this translation helpful? Give feedback.
-
There is an option in the Preferences dialog that says something like:
if you use the “Disk” option, the images are loaded to memory only when you unfold the branches that have the images and they are shown for the first time. This way you can manage big mindmaps with lot of images, just by folding the branches you are not longer using. I use this option since long time ago when RAM capacity was more of an issue, and I feel it is fast enough for not noticing that the images load only when needed. hope it helps |
Beta Was this translation helpful? Give feedback.
I just tested the method
appendBranch
and it works better, so I agree to use it. Copying does preserve node's id, but in the case that there are multiple target nodes linking to a same source node, that node id cannot be used to identify other node copies, so adding an attribute helps in this way. Here I edit a little bit more and use headless loader, maybe it runs faster in a large map, and it works no matter whether the source map is open or not. In the new code, the whole map is scanned to update multiple nodes ( from the same source, NOT different source nodes ).