I checked the forum and was not lucky for this one. So here comes my question.
I use a lot of aliases and I keep on removing nodes without knowing they have aliases. But then aliases are removed too. Why are nodes with aliases not highlighted?
A small icon or different color background would be enough to make one aware of the existing aliases.
How can I best implement that for example with an agent? I know there is $IsAlias but there does not seem any equivalent for a node that has aliases.
Tinderbox has several features that might lend themselves to giving notes āsmall icons or different backgroundsā to indicate whether this or that condition is true or false. And those conditions might matter to one user but not to another, and in fact might confuse the other user.
So, in my opinion, it is better for the end user to decide what they want to be notified about and using features, such as agents or stamps in conjunction with attributes such as $DisplayExpression, or $Badge or $Color, to tweak the interface the way that makes the most sense to you.
See, for example Querying for Agents in aTbRef, build an agent that finds the parents of aliases and assigns a $DisplayExpress to those parents.
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.
Thanks a lot to both of you for the quick and comprehensive replies. The solution works great. I made it work with a badge. $Badge=āsignalā.
I am not really familiar with editcs and wonder how I best run this now on all notes?
If I select a parent note or container, then the child notes are not updated. Do I need to select all nodes and then run the edict? Then the edict would be written into all nodes. I am not sure if that makes sense.
Pro tip: use prototypes. You then set/edit the edict in the prototype and it is automatically inherited by notes using the prototype (assuming they didnāt already have local edict - see resetting attributes).