How to perform a Delete action on a note that fulfils certain conditions?

The commonality here with an agent is the query would run a query:

inside(/Container2)

N.B. by convention full paths aren’t quote-enclosed, whereas title-only references (to $Name) are.
Now the action is:

delete(original);

…and you have a self-emptying agent. Note that as an agent action:

delete();

has no effect—delete() needs an argument—while:

delete(this);

results in an empty agent hat matches 3 objects, because the agent action is destroying the aliases in the agent as soon as it creates them, but the original notes are still there and matching the query.

Note: I place the customary warning that delete() is not an action with which the novice user should tinker. If you design a workflow dependent on it you’re probably not employing the app to best use.

1 Like