Tinderbox v9 Icon

linkedTo(scope[, linkTypeStr])


Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Operator First Added: 

Operator Last Altered: 

Operator Uses Scoped Arguments: 

Operator Has Optional Arguments: 


linkedTo(scope[, linkTypeStr])

A test for outbound links. This boolean test at returns true if the current note has a least one link to any of the note(s) defined by scope; this is optionally filtered to only links of type linkTypeStr. Put another way:

or

As this is effectively only a query term, (with a Boolean result), if trying to collect data about the linked note(s), use links() instead.

scope defines a group of items in a number of ways. An additional option to normal group descriptors wildcard designator * that matches all notes in the document and replaces the normal "all" group designator.

For linkTypeStr, links of type 'prototype' are ignored. Used in an agent, 'this' note is the alias in the agent and not its original, making this action unsuitable for testing in an agent action. If using linkTypeStr, you must use the value "*untitled" to match an 'untitled' type link (rather than an empty string, "", or "untitled").

Thus, to test if any note using the 'Event' prototype has an outbound link of the 'untitled' link type the agent query would be:

$Prototype=="Event" & linkedTo("*", "*untitled"); 

The logical opposite of this test is linkedFrom().

This function can match a link from an alias as opposed to an original (if the logical choice).

Working with aliases

If testing links using aliases (e.g. those created by an agent query) be aware that, for basic type links only, the original and alias can and may have differing numbers of basic links. Thus if wishing to check, unambiguously, the original's links from the context of one of its aliases, use originalLinkedTo() instead.

Legacy issues

This replaces the legacy #linkedTo query operator (deprecated since v4.6).