Hello! I would appreciate any help with this. I have some coding knowledge but it’s pretty basic and surface level and I think this is beyond me.
What I’m Trying to Do
I am using the Book Search plugin to find and keep track of books I am reading and compile my thoughts/notes. The problem I am experiencing is that quite a number of the books I read have titles containing colons, which is not allowed in file titles.
The plugin and/or obsidian fixes this by just getting rid of the colon in the file’s title, but these book titles can be long enough that I would want some sort of separation. I would just go in and add dashes where the colons previously were myself, but this can be tedious and I want to automate it a bit.
Things I Have Tried
I have tested using the Templater command ‘<% await tp.file.rename(tp.file.title) %>’ as part of the inline text of the note in the template for the new books and tried adding extra text, (tp.file.title + " 2"), just to see if it works, and it does but this would probably only work by adding text at the beginning or end of the title. Plus, it would happen for every single book I add.
I have tested changing the new file name format in the book search plugin settings from {{title}} to {{title}} - {{subtitle}}, but the problem is that this only works when the book’s subtitle is classified as a subtitle in Google Books’ API/Google Books (what the plugin uses to find books), and quite a few of the books I want to use don’t have the part past the colon as a subtitle and it is instead just a part of the title.
I tried adding quotes around {{title}} in the plugin settings but it seems the plugin itself gets rid of any colons in the title ahead of time because it does not appear in the title either way.
Honestly, the more I think on it, the more I think it may just be futile and I should just go in and manually change the file titles to add the dash where it needs to be. But if anyone has any other suggestions, I’m open to them.