Access commandAttachFileToBody command

I like to develop a plugin which functionality is comparable to the attachFile command (see source) but does some modifcations on the resulting Markdown code in the note.
Therefore I like to utilize the commandAttachFileToBody function (see source).

Is there any way to invoke that function from a plugin?
It appears to me that this might not be possible since that function isn't registered as a Joplin API command, right?

And if not, are there other possible approaches to create a file chooser dialog and attach a file to the joplin database?

I could need some hints :slight_smile:

You could use the data API to create a resource: Joplin Data API | Joplin
Attaching it to a note is then just a matter of inserting a link [title](:/resource_id)

Not sure about the file chooser dialog.

1 Like