Handling insert attachment event

Hello everyone,

I’m currently developing a plugin to automatically manage image attachments upon insertion. While I’ve successfully handled the ‘editor-drop’ event, I’m facing a challenge with the ‘Insert Attachment’ command, particularly on mobile devices.

Despite thorough exploration of Obsidian’s API, I haven’t found a direct callback for this event. A possible workaround involves monitoring the vault’s ‘create’ event, but it introduces complexities like backlink of the attachment and the complicated logic that will be quite different from the already-implemented one.

Is there a straightforward method to monitor the ‘Insert Attachment’ event directly?

Appreciate any insights or suggestions you might have!