Protocol for inserting text from other apps (Better Quick Capture)

It seems that there is no easy way to insert arbitrary text into logseq from a different application via the logseq:// protocol.

Such feature would be very useful to:

  • Outlook plugin to insert current email into Logseq
  • A Zotero extension could provide a “Send to Logseq” context menu
  • Automatically create log entries

This would only require a small change, Logseq already supports capturing of text using:

logseq://x-callback-url/quickCapture?

This mechanism is intended for capturing webpages through a bookmarklet, the insert template can be set in config.edn, see [1].

This should be extended to:

  • insert arbitrary text at the current cursor position without creating a new block
  • create a new block below the current block and insert text
  • same, but create block at bottom/top of page
  • create a new page (in principle this is already possible by changing the quickCapture template, but then quickCapture doesn’t work anymore)

The insert options could be:

  • Page {current page | today page | named page (create if doesn’t exist)}
  • Position {at cursor | new block below current | bottom of page | top of page} (first two only make sense on current page)
  • Open new text in Logseq {true | false}

Additionally, there should be a command to query the currently open page, filename, block, selected text etc.

[1] https://docs.logseq.com/#/page/logseq%20protocol?anchor=ls-block-63b74ff9-ee2a-4f96-b1f0-0b64c136b260

[2] Creating pages externally with the URL scheme - is this possible? - #4 by robertsalsbury