Replies: 2 comments 1 reply
-
Hi! You are correct, the SC plugin doesn't currently offer any way to do this. I can't be certain, but if I remember correctly, there might be some private API way to access other plugins' configurations. At least accessing the Obsidian main settings are discussed here: #321 . That would also be using private API. Private API means that officially Obsidian API does not provide a way to access private API content, but there's no sandboxing preventing doing it. It just means that things relying on private API may break when Obsidian updates or other plugins update. For a variable like the one you suggested, I'm ok to use the private API route - if it breaks, it won't break the whole plugin - only this particular variable. However, I can't promise any schedule for this. Anyone wanting to contribute? 🙂If someone is willing to use some time for this, a pull request is welcome.
|
Beta Was this translation helpful? Give feedback.
-
I didn't realize there wasn't a standard API for plugins to store configuration data. Maybe it would make sense to ask the Obsidian core team to make the currently "private" API, public? Or to create a public API and encourage plugin authors to use it, so that there is a more-or-less standard way to do this? |
Beta Was this translation helpful? Give feedback.
-
If there isn't already a way to do this, I'd like to suggest a mechanism to access other plugins' configuration values.
In my specific case, I needed a way to access the "Daily note" plugin's "Date format" and "New file location" values. I've written a script that copies the current day's "Daily note" to a shared drive, and I need the script to be able to find the correct source file. It started with the paths hard-coded into it, but that means people need to edit the script before using it, and I'd rather it be a drop-in thing if possible. (This page has details if you're curious.)
I ended up having the script manually parse the
.obsidian/daily-notes.json
file to get the values I need, but I wonder if there isn't a "cleaner" way to get these settings from Obsidian and pass them to the script as command line options. I haven't looked at Obsidian's APIs in detail (I have very little experience with javascript, I'm an old school C/Perl programmer and was doing DEVOPS before the name existed) so I honestly don't know if this is even possible.Does Obsidian even have an API where a plugin is able to access other plugins' settings, or are plugins "sandboxed" away from each other?
Beta Was this translation helpful? Give feedback.
All reactions