Giter Club home page Giter Club logo

Comments (7)

Zachatoo avatar Zachatoo commented on July 21, 2024

You're setting the file name to an empty string, what are you expecting the file name to be when the file is created?

fileName: ""

from templater.

Noodle-Bytes avatar Noodle-Bytes commented on July 21, 2024

Yes sorry I should of mentioned that, I leave file name blank, then inside the journal_template there is a templater block that renames it to todays date. I've copied that in below. I'm not sure that's the issue, as it creates the new note with today's date fine, just at the wrong level in the directorys.

<% tp.file.rename( tp.date.now("DD-MM-YYYY") ) %>

from templater.

Zachatoo avatar Zachatoo commented on July 21, 2024

What should the file name be before your template renames it? That's where I'm a bit lost, I need to know what it was doing before.

from templater.

Noodle-Bytes avatar Noodle-Bytes commented on July 21, 2024

I don't currently set it, as it is immediately renamed. So I'm guessing it is either empty string or defaults to untitled.

from templater.

Noodle-Bytes avatar Noodle-Bytes commented on July 21, 2024

Yes I just tried it without the rename command in the template and it just gets set to untitled.
I have just tested it with setting a default name for the note instead of an empty name and it works fine in latest version. So guessing it's just a weird edge case of having no file name messes up the path creation. Happy to close this issue if you want, and I'll just add file names into my buttons.
Thanks for your help.

from templater.

Zachatoo avatar Zachatoo commented on July 21, 2024

I was able to encounter the same issue using just Templater and tp.file.create_new(). Here's the equivalent I tested with.

<%*
const templateFile = tp.file.find_tfile("Templates/journal_template.md");
const folder = app.vault.getAbstractFileByPath("Work/Organiser/DB/Journal");
const fileName = "";
await tp.file.create_new(templateFile, fileName, true, folder);
-%>

I have fixed this in 2.2.3, I believe this will also resolve the issue you were facing with metabind!

from templater.

Noodle-Bytes avatar Noodle-Bytes commented on July 21, 2024

Brilliant thank you 👍

from templater.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.