quickadd icon indicating copy to clipboard operation
quickadd copied to clipboard

[FEATURE REQUEST] how to get command id

Open xsevy opened this issue 1 year ago • 4 comments

Not sure this is a request because it might be that there's such a feature. I use quickadd and meta bind. I would like to make a button that would trigger a quick add action.

style: primary
label: abcdef
id: add-record-button
action:
  type: command
  command: [command]

xsevy avatar Mar 24 '24 21:03 xsevy

Hi @xsevy

If you use app.commands.listCommands().filter(c => c.id.includes('choice')) in the developer tools console, you can see all the command IDs.

For example: image

You can open the developer tools with CTRL+SHIFT+i. CMD instead of CTRL if you're on Mac.

Hope this helps!

chhoumann avatar Mar 25 '24 15:03 chhoumann

You can get slightly better formatting if you use this:

console.table(app.commands.listCommands().filter(c => c.id.includes('choice')))

image

chhoumann avatar Mar 25 '24 15:03 chhoumann

As for whether this is a feature, it might be useful to add a 'Copy ID' button somewhere :)

chhoumann avatar Mar 25 '24 15:03 chhoumann

QuickAdd might not, but Meta Bind has such a command: Cmd/Ctrl-P to open the command palette: Meta Bind: Select and Copy Command ID aka obsidian-meta-bind-plugin:copy-command-id

ces3001 avatar Jun 13 '24 17:06 ces3001