-
-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can I rewrite this any better - without setTimeout? #1331
Comments
Have you tried using the tp.hooks.on_all_templates_executed hook? Also I would consider a different way of getting the current file. Would look something like this. tp.hooks.on_all_templates_executed(async () => {
var file = tp.file.find_tfile(tp.file.path(true));
// var file = app.workspace.getActiveFile();
await app.vault.modify(file, "");
}); What kind of hook would you be looking for? I'm not sure what this template is trying to accomplish. |
I have a shortcut on my android that when I click it it opens Obsidian and creates a file called Untitled in a specific folder. Once that's complete, I can start writing in the file. Sometimes I want to spin off different files from that one. For example I may write [[Koenar]], and press on it. Templater does its usual activities of writing textToday. From there I just move the file (I have a shortcut CTRL+M, or a button above the keyboard on Android). Some callbacks for deciding what name the file should have, with conditions, would be nice. I will give that hook a try, I had some issues with it yesterday.. |
Sometimes if Obsidian is lagging, the previous file I was in gets obliterated (content becomes empty).
Can there be more hooks?
I've considered increasing the time from 500 to 1500. It is still not perfect.
I've posted the code I'm working with right now at the end.
Much appreciated!
The text was updated successfully, but these errors were encountered: