Getting a note's content in plain text form

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting a note's content in plain text form

michael
Hey Guys,
I tried to write a simple addon to export a notes content to a tex file.
However I did not yet manage to get rid of the html tags.

id = node.getId()
fn = id + ".txt"
new File(fn).withWriter{ it << "<!-- "+ fn +"\n-->" + node.getNoteText()}

also
node.getNode.getText() 

seems not to work.

Could you possibly add what is needed?

Any help is greatly appreciated.


Reply | Threaded
Open this post in threaded view
|

Re: Getting a note's content in plain text form

Felix Natter
Administrator
"michael [via Freeplane Developer]"
<[hidden email]> writes:

> Hey Guys,

hi Michael,

> I tried to write a simple addon to export a notes content to a tex file.
> However I did not yet manage to get rid of the html tags.
>
> id = node.getId()
> fn = id + ".html"
> new File(fn).withWriter{ it << "<!-- "+ fn +"\n-->" + node.getNoteText()}
>
> also
>
> node.getNode.getText()
>
> seems not to work.

What you want is probably getPlainNote():

https://github.com/freeplane/freeplane/blob/1.3.x/freeplane_plugin_script/src/org/freeplane/plugin/script/proxy/NodeProxy.java#L264

Best Regards,
--
Felix Natter