jon-heard / obsidian-inline-scripts

Obsidian plugin: Type text shortcuts that expand into javascript generated text.
MIT License
129 stars 4 forks source link

incorrect update of properties #82

Open jonnyggarcia opened 1 year ago

jonnyggarcia commented 1 year ago

Hello,

I have the following script:

print ("dominio_desc: " + dominio_desc); print ("tema_desc: " + tema_desc); print ("progresso_max: " + progresso_max);

let char = expand("notevars get . personagem");

var op = expand('notevars set "' + char + '" exploracao ' + dominio_desc); var op = expand('notevars set "' + char + '" tema ' + tema_desc); var op = expand('notevars set "' + char + '" progressomax ' + progresso_max); var op = expand('notevars set "' + char + '" progresso 0');

Here is the print output

Inline Script Shortcut: dominio_desc: Passagem plugin:obsidian-text-expander-js:4823 Inline Script Shortcut: tema_desc: Infestado plugin:obsidian-text-expander-js:4823 Inline Script Shortcut: progresso_max: 3

Here is the YAML of the note where the script is executed


tags: personagem: Jezebel backlink:

Here is my YAML of the note im trying to update


tags: nome: Jezebel Seráphine tema: exploracao: progressomax: 0 progresso: 0

Here is my YAML after the script runs


tags: nome: Jezebel Seráphine tema: "Infestado" exploracao: "P 3sagem" pro 0essomax: 0 progresso: 0

TEMA property is correct. Passagem is getting the number 3 which was set to the PROGRESSOMAX Progressomax attribute is getting a 0 in the middle coming from PROGRESSO.

I have tried everything i could, but nothing works. Please help.