I have a note called “Note’ in my root. The “Note” has an attribute called “$Term”. When I add a term e.g. Lonon, to $Term and run the following stamp, it create a new note called “London” in my Resources container and links it back to “Note”. The stamp works well for creating and making a link.
However, when I remove the term (e.g. London) from the $Term, and run the Stamp, the link from London to “Note” still persists. How can I remove this link (back to “Note”) but, preserve the note “London” (i.e. not to delete it), when a term (e.g. London) is removed from the $Term in the “Note”. Thank you.
var:string vCont=“/Resources Notes/”;
var:string vNote;
var:string vPath;
// Pass 1: Remove links to Resource notes no longer in $Term
collect(vCont).each(n){
vNote = $Name(n);
if(!$Term.contains(vNote)){
unlinkTo(n);
};
};
// Pass 2: Create notes and link for current $Term members
$Term.each(x){
vNote = x;
vPath = vCont + vNote;
create(vPath);
linkTo(vPath);
};