How to change the $Container of an alias?

Hello. Even after reading all the relevant material in aTbRef on moving notes by having an agent set the value of $Container, I still do not see how to move aliases this way. I mean aliases that are not aliases made by the agent, aliases I’ve created manually and moved around in times past. Try as I might, my $Container-setting actions can only move originals.

Thanks!

  1. I made three notes, a, b and c. Then I made an alias of a.
  2. I selected the alias
  3. I apply the following stamp:
$Container(this)="/c";

This does move the alias inside c and leaves the original unmoved.

In the case of an agent’s OnAdd action, though, we have a problem, because this is bound to the alias being added, and original is bound to the original note. So there’s not an easy way to refer to “the alias matches the agent query”, and there might in fact be a bunch of aliases that match.

You could perhaps build a list of all the aliases of interest (perhaps using collect_if(...)) and then set the $Container of that list.

Setting $Container works for me:

$Container = "Large";

Here we have ‘a’ and an alias, created manually as per the OP’s post:

I stamp the alias with the above stamp:

Given this, the most likely cause(s) of failure:

  • if not selecting/stamping the alias directly, you may actually not be acting on the object you assume you are. If needing to work via action(rather than the UI) consider using find(). This is because find()—unlike agent queries—doesn’t dedupe matches/weed aliases. Of course you’ll still have to pick the right alias, if several.
  • the target container may be a duplicate (name or path). Try again using an ID or IDString to see if that works as the latter don’t allow such ambiguities. Bear in mind that where name/path ambiguity exists, Tinderbox always picks the first match by Outline Order. Only using IDs routes around that as an ID (even for laiases) is unique.

Thanks to you both. Yes, the stamp method works fine. I’m only troubleshooting the apparent alias-blindness of agents.

To simplify the problem: Let’s say that I want an agent to move a note and all of it’s aliases into some container, by any means. Can this be done?

No, at present it (probably) cannot be done. I say “probably” because there’s a decent shot it can be done, even though I don’t think so.

The problem is, why would you want to do this?. The typical intent of aliases is to place a note in two places at once. So you seem to be opposed to the natural inclination off aliases.

My suspicion is that all this will be more clear if we stop talking of abstract aliases here and there, and instead talk about the actual problem we’re trying to represent.

1 Like