$IsAlias works both ways:
true - the object is an alias
false- the object is not an alias, thus the original note of any alias will have this value.
There is no ‘does this note have any aliases?’ command, but it is possible to test if a note has aliases using
find(). First, I would point out that automatically generated aliases inside agents and aliases created manually by us users cannot be differentiated**.
Unlike an agent query, a
find() query returns all instances of a an in-scope match both originals and all their aliases. Thus if your scope is the whole document, if you test a note for note’s matching the current note’s name (assumption! no duplicate original note names), than we can filter the results. I tested this edict :
Any note that has aliases is bright red or else it is/reverts to its default colour. I’ve used colour here but you can set whatever indicator you like such as some of the alternates already suggested in the previous reply.
** Actually, that is possible by extending the query:
Whilst for both originals and aliases outside agents their parent has no $AgentQuery value, the $IsAlias term has already filtered original notes, so that the extra query now whittles away aliases that only exist within agents. Neat!
An edict is a good vehicle for this sort of thing as it runs infrequently yet can easily be refreshed one-off on demand. Note you can’t use an agent for this, both because
find() isn’t intended for agent queries and because you’d be chasing you tail is you weeded aliases inside agents.
(Tested in v7.5.4 on macOS 10.13.6)