obsidian-advanced-uri icon indicating copy to clipboard operation
obsidian-advanced-uri copied to clipboard

Is it possible to click on confirm button when executing command with advanced uri?

Open AlexW0lf1 opened this issue 1 year ago • 1 comments

Let's say I want to execute Export to Pdf command from powershell

URI looks like this

obsidian://advanced-uri?vault=Project_Obsidian&filepath=URI.md&commandid=workspace%253Aexport-pdf

After executing command I see a modal asking for additional options and button "Export to pdf"

Can I add additional arguments to this uri, so I won't have to press button manually?

AlexW0lf1 avatar May 23 '24 11:05 AlexW0lf1

Right now I'm using ?eval argument to execute some js and manipulate DOM to select options and click button, but this seems like a bad solution. Would have been better if I could pass all arguments through uri

Also, is it possible to execute from command line in background on windows/linux? Without opening GUI

AlexW0lf1 avatar May 23 '24 14:05 AlexW0lf1

It's now available in v1.43.0 :tada: Just add confirm=true as parameter to the command uri. It looks for the first main button and clicks it.

Vinzent03 avatar Aug 25 '24 19:08 Vinzent03

confirm=true indeed is working well, thank you for adding this feature!

However, then a system dialog pops up, asking where to save the PDF (and then the PDF opens right after export). Do you know if there is a way to save the file to a default location such that no dialog would pop up? This would allow me to fully automate my workflow.

qbilius avatar Dec 02 '24 07:12 qbilius

I tried that myself as well, but couldn't find a way so far.

Vinzent03 avatar Dec 02 '24 12:12 Vinzent03