Skip to content

[FEATURE REQUEST] Get selected text in macro script #483

@Qyriad

Description

@Qyriad

Is your feature request related to a problem? Please describe.
In Templates and Captures, {{VALUE}} is set to selected text, if there is any. There does not appear to be any way to get the selected text in a Macro, however.

Describe the solution you'd like
Something like:

module.exports = async (params) => {
    // One possibility.
    const selection1 = params.selection;
    // Another possibility that sort of mirrors the way it works for other Choice types.
    const selection2 = params.variables["VALUE"];
    // And finally one that simply uses a JavaScript API.
    const selection3 = await params.quickAddApi.getSelection();
}

or anything equivalent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions