czottmann / obsidian-actions-uri

A plugin for Obsidian (https://obsidian.md) that adds additional `x-callback-url` endpoints to the app for common actions — it's a clean, super-charged addition to Obsidian URI.
https://zottmann.dev/obsidian-actions-uri/
MIT License
138 stars 6 forks source link

Might be some problems in the ActionsURI Document #88

Closed Moyf closed 8 months ago

Moyf commented 8 months ago

In this document page: https://zottmann.dev/obsidian-actions-uri/routes/file/ image

I'm not sure if it's a typo because when using /vault/get-active I got nothing return..

And if use file/get-active I can get the result, but not like what is said in document: image

Instead, I still got the relative path to the vault, rather than the fullpath of file: image

czottmann commented 8 months ago

Hi @Moyf, thanks for your ticket.

I'm not sure if it's a typo because when using /vault/get-active I got nothing return..

Yes, it's a typo, thanks for reporting it! 😅

And if use file/get-active I can get the result, but not like what is said in document:

Ah, that's a mistake on my end, apologies. result-filepath will return the path starting from the vault's root folder.

Both errors are fixed now!

Moyf commented 8 months ago

Thank you for fixing it! <3

By the way, I'm not sure if I missed something - is there any API to directly obtain the absolute path of active file in one step? Or do I have to first get the path of the vault through /vault , and then combine it with the relative path? (This way requires sending two requests, which can be a bit troublesome 🤔)

czottmann commented 8 months ago

It's the latter. Obsidian itself does not return absolute paths, so Actions URI doesn't, either. Most of my own work happens on macOS and iOS, and I almost never need the absolute path for anything. ;)

Moyf commented 8 months ago

It's the latter. Obsidian itself does not return absolute paths, so Actions URI doesn't, either. Most of my own work happens on macOS and iOS, and I almost never need the absolute path for anything. ;)

Roger that, thanks! :D