I want to insert a BUTTON to link to a database created using the official bases plugin, which requires me to copy and paste the database file’s URL. However, I discovered that when I created the button using the URL of the desktop database file and then ran the official sync, the button synced to my phone wouldn’t open. Upon checking the URL of this database file on the mobile device, I found it differs from the desktop URL. Can this issue be resolved? Alternatively, are there any workarounds? (I’m using the third-party “Button” plugin.)
Translated with DeepL.com (free version)
1 Like
Try using an Obsidan URI instead of the type of path you are using now. You can use the Copy Obsidian URL command (found in the command palette, the 3 dot menu, and other places) to get a URL that opens the current note.
(Sorry about the French accentuated letters…)
The “Copy Obsidian URL” command gives a URL like this one :
obsidian://open?vault=Calepin&file=%E2%9F%A3R%C3%A9ception%2Fscrap
This URL basically asks Obsidian to open the designated note (file). It works from the outside world, everywhere a URL can be clicked (a mindmap program, for example).
Problem : if you move your note, the link is broken.
Solution : strip the path part and keep just the filename :
obsidian://open?vault=Calepin&file=scrap
Now, as long as you don’t change the name of your note and as long as this name is unique across the whole vault, Obsidian will find the note wherever it resides inside the vault.
I have a Keyboard Maestro macro that does exactly this :
- asks Obsidian for the URL of the current note
- strips the path from this URL
- copies the URL to the system clipboard
Now, I can paste this URL wherever I need it.
My two cents…
Olivier 