Trouble creating files in user script #1239
Replies: 2 comments
-
This is solved now. I used "tp.file.find_tfile(filename: string) == null" and that solved the issue |
Beta Was this translation helpful? Give feedback.
0 replies
-
// using `await` to wait for result
const exists = await tp.file.exists(noteTitle);
if (!exists) {
/* do stuff */
} I like your workaround though! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What I'm trying to do
I'm trying to create a template that creates a new note for each string in a list of strings that I paste into a prompt with a file name equal to that string using a user script
Things I have tried
This is the code I currently have:
This is resulting in nothing happening when I try to use the template, which contains this:
Just for reference, the list of strings are FEN notated positions in chess, such as these
rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1
rnbqkbnr/pp1ppppp/8/2p5/4P3/8/PPPP1PPP/RNBQKBNR w KQkq c6 0 2
rnbqkbnr/pp1ppppp/8/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R b KQkq - 1 2
Any help would be greatly appreciated. Thanks!!!
Beta Was this translation helpful? Give feedback.
All reactions