Include variables from Textexpander snippet inside Javascript code (nested snippets)

Hello folks,

I’m trying to create a snippet that allows me to calculate three variables with each other. I wrote a javascript snippet and nested it into the main snippet. With the use of ChatGPT I was able to build a snippet that actually works. But I’m asking myself, is there a solution, that a fill-in field from the main snippet can be used for a variable inside the javascript snippet. I read the small explanation on Working with JavaScript Snippets but that would not help me, since I have never coded with js before an I’m myself not a programmer and have basic knowledge about programming. This is the code I’m using for javascript.

function calvol(digit1, digit2, digit3) {

var vol = digit1 * digit2 * digit3 * 0.52;

return vol;


var digit1 = parseInt(“%filltext:name=x:default=4,2%”);

var digitl2 = parseInt(“%filltext:name=y:default=4,2%”);

var digit3 = parseInt(“%filltext:name=z:default=4,2%”);

var result = calvol(digit1, digit2, digit3);


Can anyone give me an example to address the fill-in field name from the main snippet? That would be awesome!