Vinzent03 / obsidian-advanced-uri

Advanced modes for Obsidian URI
MIT License
727 stars 43 forks source link

[Feature Request] Pass additional context in URL #77

Closed panahi closed 1 year ago

panahi commented 2 years ago

Use Case I'm starting to build a number of automations that leverage obsidian-advanced-uri to invoke commands (some external to obsidian, like via shortcuts, and some internal from buttons in dataview output).

For something like what I'm trying to do in https://github.com/Vinzent03/obsidian-advanced-uri/issues/76, the flow ends up like:

My ultimate goal is to not have to navigate to the other file itself. I think this is possible if advanced-uri were enhanced like:

This way, I could pass extra params like &taskfile=&taskline= and access them without the weird clipboard nonsense. I have both of those values at the time of creating my dataview table.

Vinzent03 commented 1 year ago

The plugin is already available like all other plugins via app.plugins.plugins['obsidian-advanced-uri]. How would the api object be different from the current available methods?

Storing the last query parameters is an easy feature.

panahi commented 1 year ago

@Vinzent03 Sorry, I meant that while the plugin is accessible there isn't any (that I can see) fields exposed from the object that might contain information like the last query parameters. But that's a moot point I guess - adding a way to get the last query parameters is enough for me

Vinzent03 commented 1 year ago

Does the new version help you? You can access via app.plugins.plugins["obsidian-advanced-uri"].lastParameters

panahi commented 1 year ago

That's awesome, thanks for the update. I'll try it out this weekend!

panahi commented 1 year ago

Works great! I was able to change some workflows so that I don't need to change the active file or track state in the clipboard :). And my quick add macro could drop this nonsense and just run the user script

image

hihihlo commented 1 year ago

@Vinzent03 May I suggest to add the info into document ? app.plugins.plugins["obsidian-advanced-uri"].lastParameters I had a similar problem today, and found the post accident. This is a powerful feature !

Vinzent03 commented 1 year ago

Good idea! Done.