“Variable interpolation problem” (as Claude identified it)
I have a stamp, that has worked as expected in months gone by, that reads the $persons attribute in a note (List type) and creates a note for each of those persons (may be zero to many) in a container identified as /Resources Folder/Persons Folder.
This is the content of the stamp:
// PURPOSE
// - When this stamp is pointed at a note, reads the $persons attribute.
// - For each person found, it creates a note for that person in
// - Resources Folder/Persons Folder.
var: string vContainer = "/Resources Folder/Persons Folder";
var: string vAlphaContainer;
var: string vPath;
var: string vNote;
var: string vLinkType = "Person";
$persons.each(x) {
if (x.substr(0,1) == "A" | x.substr(0,1) == "a") {vAlphaContainer = "/A/";};
if (x.substr(0,1) == "B" | x.substr(0,1) == "b") {vAlphaContainer = "/B/";};
if (x.substr(0,1) == "C" | x.substr(0,1) == "c") {vAlphaContainer = "/C/";};
if (x.substr(0,1) == "D" | x.substr(0,1) == "d") {vAlphaContainer = "/D/";};
if (x.substr(0,1) == "E" | x.substr(0,1) == "e") {vAlphaContainer = "/E/";};
if (x.substr(0,1) == "F" | x.substr(0,1) == "f") {vAlphaContainer = "/F/";};
if (x.substr(0,1) == "G" | x.substr(0,1) == "g") {vAlphaContainer = "/G/";};
if (x.substr(0,1) == "H" | x.substr(0,1) == "h") {vAlphaContainer = "/H/";};
if (x.substr(0,1) == "I" | x.substr(0,1) == "i") {vAlphaContainer = "/I/";};
if (x.substr(0,1) == "J" | x.substr(0,1) == "j") {vAlphaContainer = "/J/";};
if (x.substr(0,1) == "K" | x.substr(0,1) == "k") {vAlphaContainer = "/K/";};
if (x.substr(0,1) == "L" | x.substr(0,1) == "l") {vAlphaContainer = "/L/";};
if (x.substr(0,1) == "M" | x.substr(0,1) == "m") {vAlphaContainer = "/M/";};
if (x.substr(0,1) == "N" | x.substr(0,1) == "n") {vAlphaContainer = "/N/";};
if (x.substr(0,1) == "O" | x.substr(0,1) == "o") {vAlphaContainer = "/O/";};
if (x.substr(0,1) == "P" | x.substr(0,1) == "p") {vAlphaContainer = "/P/";};
if (x.substr(0,1) == "Q" | x.substr(0,1) == "q") {vAlphaContainer = "/Q/";};
if (x.substr(0,1) == "R" | x.substr(0,1) == "r") {vAlphaContainer = "/R/";};
if (x.substr(0,1) == "S" | x.substr(0,1) == "s") {vAlphaContainer = "/S/";};
if (x.substr(0,1) == "T" | x.substr(0,1) == "t") {vAlphaContainer = "/T/";};
if (x.substr(0,1) == "U" | x.substr(0,1) == "u") {vAlphaContainer = "/U/";};
if (x.substr(0,1) == "V" | x.substr(0,1) == "v") {vAlphaContainer = "/V/";};
if (x.substr(0,1) == “W” | x.substr(0,1) == "w") {vAlphaContainer = "/W/";};
if (x.substr(0,1) == "X" | x.substr(0,1) == "x") {vAlphaContainer = "/X/";};
if (x.substr(0,1) == "Y" | x.substr(0,1) == "y") {vAlphaContainer = "/Y/";};
if (x.substr(0,1) == "Z" | x.substr(0,1) == "z") {vAlphaContainer = "/Z/";};
vNote = x;
vPath = vContainer + vAlphaContainer;
create(vPath,vNote);
linkFromOriginal(vNote,vLinkType);
};
What happens is that “persons” notes are being placed in a container called “vContainer” right below the note to which the stamp is being applied.
Claude’s Response
This is a variable interpolation problem with the create() and linkFromOriginal() calls. Tinderbox is treating vPath and vNote as literal strings (the container name and note name respectively) rather than resolving them as variables.
The fix is to use ^value() to force variable resolution inside those function calls:
create(^value(vPath), ^value(vNote));
linkFromOriginal(^value(vNote), ^value(vLinkType));
I have tried Claude’s suggestion, but with the same incorrect result. I just upgraded to 11.7.0. How do I get the vPath = vContainer + vAlphaContainer to use the value of vContainer instead of the literal string “vContainer”?

