Is it possible to either get the entire content of the current page, or the content the user has selected?
Preferably with space script, but I’d be okay with it in a plug as well.
Basically I’m wanting to write some functions/commands that can take either a whole note or part of it and send it to an api (or external shell command), have it do some stuff and return new content to replace the selected portion.
I saw space.readPage exists to read the content of a page, but I’m not sure how a command can figure out the name of the page currently open.
Right. These syscalls don’t appear on that page because they’re not available on the server, just on the client. Therefore they can only be used for some use cases like commands (which run in the client), but not custom functions used in templates (rendered on the server). The reason they don’t appear on that list is that that list is rendered by a template, which queries for all available syscalls… on the server.
Yes, that’s how you can think about it. The only remark here is that editor.* are simply not available on the server, so they cannot be run there. You’ll get an error.