Define "current note" with action code

  1. You do need to test that allMyNotes is empty, since .each(){ … } will do nothing if its list is empty. So now we have
var:list allMyNotes     = collect(children(startNode),$IDString);
allMyNotes.each(singleNote){
     singleNote.unlinkFrom(all,"agree");
};
  1. The unlink and link operators accept group designators, so you could avoid the explicit loop:
unlinkFrom(children,"agree");
  1. For a rule, this is bound to the note that owns the rule. If you want some other note to be this, you use eval():
eval(/path/to/note,"unlinkFrom(all,'agree')" );

1 Like