Tinderbox Forum

Keeping links to notes when running an agent

Hi All, I asked a question in an old thread that is no longer relevant, so Paul suggested I start a new thread.

I’m looking to run an agent and pull organizations an assorted products, keep the original linking I had done, and lay the results in the agent in an org chart like fashion. I first started with trying to get the linking working (see below). Have no clue how to go about the layout.

I tried using this in an agent query:
$Organization=“Bitdefender”;If($Prototype=“Organization Prototype”){linkTo(find($Organization(that).contains($Name)&IsAlias,“Product”);&MySet.each(X){if($IsAlias(X)&linkedTo(X,“Product”)&$Organization.contains($Name(X))==false){unlinkTo(X,“Product”);};};$MySet=;}

I get the expected organizations and products but they’re not linked. I would like to 1) set the links and 2) have a Service link type come in as well as products.

Does anyone of the original example I could look at? Can someone lend a hand with the above?

Finally, is there a way to lay this out so that the Organization, in this case, Bitdefender, is on to the top of the map view and the products are laid out underneath it and linked to it? I’d like it to show more like a stacked org. chart than a grid, column, or box.

As I mentioned in the other thread, that code looks at a glance like it has numerous syntax errors. It might be doomed to fail, if that’s the case.

But it is such spaghetti that it is hard to parse exactly.

Sorry to be dense, but I’m confused – there’s a lot going on in the post, above.

What does that mean? This?

  • In an agent:
    – gather organizations and their associated products;
    – retain the links in the original notes;
  • display the results in the agent container in an “org chart like fashion”.

Does that mean you want the agent to display data in a hierarchy?

What does that mean?

Hey Paul, great questions. I apologize if I’m not being clear.

I run the agent (see agent image). I click in on the agent, I get a grid (see grid image). What I’d like is the agent to pull the relevant items, with the links (both Service and Product links), and lay them out where the Organization is on top and the products are below (see hierarchy layout).

As for the code being a mess, I’m really not skilled enough to say just yet. Other than adding the $Organization=“Bitdefender”;. the code syntax is nearly identical to the code in the previous post. I just change the Link Type name, the string name and the tried playing with the LinkTo vs. From setting. Hope this helps.


Action code grew out of internal scripting for exploration of structure, and for export. I’m not sure it is really optimal for large auto-layout tasks, even if the notes are all he same (map size). Plus, the code can’t control the paths of the links. I’d suggest this sort of layout is better done manually with the View → Arrange menu options. The eye is better able to see if the aesthetics—which seem to be the desired outcome—are good our not.

You could look AppleScript as well 9if you know AppleScript) to try this task. My experience says coding this is time that could be more meaningfully spent on understanding and reporting the actual data. For instance a pretty picture might be more quickly made by exporting some data and giving it to OmniGraffle. A common misunderstanding, especially as map view is the default view is that Tinderbox is a drawing app; it is not. One can make nice images like in your screen grab above but IME this ends up being a fiddly manual task. The point there is at some point making nice pictures gives diminishing returns. I think many users eventually find their own happy medium where a layout they can achieve quickly/easily without undo effort is good enough even if a prettier one can be made.

Or am I misunderstanding the aim here? (A genuine question - not snark)

Hey there, I agree with you. the layout idea may not be worth the time, bur retaining the links would certainly be nice. Anyway, not urgent. Thanks for your consideration.

Per one of your other post, like I did to create the image above, is to just copy the aliases and then manually do it. This will have to be repeated if new elements are needed, but given the cost (aka time) tradeoff it is probably a good tradeoff.

Bear in mind aliases and originals share text links (always outbound) but not necessarily in/outbound basic links - see more on Linking & Aliases.

separately note that as well as linkTo() there is a linkToOriginal() operator.