The safest method, if you are going to use actions involving offsets† is to use unique note titles (i.e. $Name). In some cases that isn’t feasible. Tinderbox is perfectly happy to have multiple notes with the same title, as each note has a unique $ID value. However, queries and actions use titles (or fill paths)
† What are ‘offsets’? this is where you want to refer in a query, or action, to another note by name or path. This:
$Color = $Color("Some note");
Sets the current note’s $Color to the $Color value used in a note called “Some note”. But if “Container A” and “Container B” both have a note called “some note” we can use the full path instead (i.e. $path instead of $Name) as our offset:
$Color = $Color("/Container A/Some note");
It is possible to use a note’s $Id as an offset reference (see here) though I’d suggest only doing so if there is no easier way to avoid the situation.