I’m creating an action to send text to Obsidian via the URL scheme. I have everything working fine except the parameter in the URL scheme that takes the “path” for the file.
The proper coding looks like:
path%2Fto%2Fthe%2Ffile%2Ftitle
However, when I try to put that in the addParameter field, it doesn’t encode the slashes properly. It leaves them as slashes. For whatever reason, this causes the note to be created in Obsidian, but not in the specified folder.
I have tried many ways to send the correct information to Obsidian, but if I use the %2F encoding, Drafts re-encodes the percent sign, and if I type slashes in the path value, Drafts doesn’t encode them. Any way around this?
Can you share the details of how you are doing this as the action? We can then take a look to determine if it is a data/action onfig/device/app issue. Otherwise we’re guessing and I can think or maybe two of three ways at least that you could have something roughly set up.
This is one of those encoding bits not all libraries agree on. CallbackURL is using Apple’s URLQueryItem to process and encode queries parameters, and it does not encode the / (which most consider should be unencoded per RFC.
JavaScript does encode it…which is likely what Obsidian is using under the hood to decode the values.
Ok thanks. I think maybe we should delete this thread because my error had nothing to do with the path. Wasn’t getting the title right from the prompt, so it’s all fixed now. The slashes are fine!