unlinkTo("item"[,linkType])

Tinderbox Icon


Operator Type:   Function
Operator Scope of Action:   Group
Operator Purpose:   Linking

unlinkTo("item"[,linkType])

This removes all basic links to item from the current note.

item (string) must be double-quote enclosed if the target title includes characters other than letters, numbers or spaces. The argument must be a note $Name or item designator or expression resolving to an item name. $Paths cannot be used (in other operators $Name and $Path are usually acceptable alternatives).

From 5.9.0, item may be group scoped including use of group designators and operators like find,() collect and links().

linkType (string). Optionally, link deletion can be constrained to one or more types supplied in linkType. The argument allows simple regular expressions; "disagree|example" would delete links of type 'disagree' and 'example' but leave others untouched.

Both arguments are evaluated. This operator does not require a left-side argument, simply calling effects a result. No change occurs if the described link does not exist.

Relevant similar operators: linkTo, linkFrom, unlinkFrom.

From v5.1.0, use of this action does not shift note focus; in addition if item contains operators (brackets, plus, minus, etc.) Tinderbox will first look for a match to the literal item string and only if there is no match will the app try evaluating to operators and testing the resulting string. For example:

unlinkTo("Example 1 (a test)") 

will unlink the note named 'Example 1 (a test)'. If no note matches this string, Tinderbox will attempt to evaluate the string. Thus for:

unlinkTo("2+2") 

will unlink the note named '2+2' but no match will look for a note named '4'.

From v5.10.1 this function can target an alias as opposed to an original (if the logical choice) and can accept a group scope.

Use in agents: beware that the action is working on an alias of the current note and note the current note itself. As originals and aliases support discrete basic links this function should not generally be used in an agent. The best way to use the function is by using a prototype and apply a $Rule to it thus running the code in all notes using the prototype.


Possible relevant notes (via "Similar Notes" feature):

Up: Full Operator List
Previous: unlinkFrom(item[,linkType])  Next: uppercase(data) 

A Tinderbox Reference File : Actions & Rules : Operators : Full Operator List : unlinkTo("item"[,linkType])

Quicklinks: Attributes | Action Codes | Export Codes | Designators | Date Formats | aTbRef Site Map

[Last updated: 16 May 2012, using v5.11.1]


Search:

Google search aTbRef for:  


Creative Commons Licence

aTbRef by Mark Anderson is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

[See aTbRef CC licence Attribution & Waiver info]

Made with Tinderbox