Plagins like Templater and QuickAdd are unable to run the simplest java-scripts on my PC

What I’m trying to do

I can’t run scripts in either the Templater plugin or QuickAdd. Even the simplest “Hello World” macro, which should simply display a notification, doesn’t work, and the developer console remains blank or gives out errors like “> Templater Error: Template parsing error, aborting.
Template syntax error: missing ) after argument list
eval ”

Things I have tried

I tried both Templater and QuickAdd, ran several tests using the simplest code combinations, no result whatsoever. Even “hello world” code isn’t working

what code are you trying to run

1 Like

Research Assistant.md (232 Bytes) for example

have a look at templater execution command docs page:

<%* console.log("hello") %>

Basically understanding the difference between <% %> and <%* %> in templater is what will allow you to use javascript

1 Like

that was not the lates version of the file, I already fixed the * problem and yet no progress. morever, when I changed plugin to QuickAdd, even the following simplest macros wouldnt work:

1 module.exports = {
2 entry: async (QuickAdd) => {
3 new QuickAdd.obsidian.Notice(“QuickAdd макрос работает!”);
4 }
5 }

Could you quickly describe how you add a new templater note and how you run it?
Just to exclude any simple things here.

1 Like

I actually used gemini CLI to help me with all that, it would create a .md file and give an operating instruction and I was to test it manually into Obsidian, copy an error or describe it directly to an AI agent and over and over again) just starting out in this area, so I have use a lot of help from different AI’s

Then maybe try creating a new note and adding this line:

<%* console.log("hello") %>

Place the note in your Templater folder (make sure it’s set correctly in the Templater settings), then use the command palette to run Templater: Open insert template modal and select your template.

After that, check the console.

1 Like

So this script runs, meaning the problem isn’t Templater but your scripts instead.

1 Like

alright, thx, what would be ur recommendations regardion writing those scripts in general? I could have the cli agent read the “Execution Commands - Templater” docs to understand the fundamentals, as a starter, but what else?? I am incredibly grateful in advance to you, community representatives, for your help and advice!

I’d recommend gaining enough knowledge to correct the errors in your scripts which the AI will do.

You (or the AI) should be familiar with Templater syntax, JavaScript syntax, and the Obsidian API.

Also keep in mind that running scripts you don’t fully understand can harm your vault, so make backups in case something gets changed or deleted accidentally.

1 Like

thanks again! I’l try this new approach

Do not ask our community for help with unverified AI output. It wastes our volunteers’ time (and yours).

When you ask for help here, feel free to mention that you have asked AI and that it didn’t work, but don’t ask for help with the AI’s wrong output. The ways it is wrong aren’t likely to be worth troubleshooting. Ask your original question, the one you asked the AI for help with.

Thank you, and good luck!

2 Likes