Tinderbox v11 Icon

createTextLink(sourceItem, destinationItem, regexAnchor [, linkTypeStr, guardStr])


Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Data Type Returned: 

Operator First Added: 

Operator in Current Baseline: 

Operator Last Altered: 

Operator Uses Regular Expressions: 

Operator Has Optional Arguments: 

 Operator  [other Operator type actions]

 Item  [operators of similar scope]

 Linking  [other Linking operators]

 success boolean

 v11.7.0

 11.7.0

 As at baseline

 [More on regular expressions in Tinderbox]

 [More on optional operator arguments]


createTextLink(sourceItem, destinationItem, regexAnchor [, linkTypeStr, guardStr])

New to v11.7.0, the createTextLink() operator can be used for text link creation. The arguments sourceItem and destinationItem must each be defined so as to identify a single (existing) item. The link's anchor text is defined by regexAnchor. This is a regular expression whose first match becomes the link anchor. Typically, regexAnchor will simply be a literal string of the anchor text.

There are two optional arguments:

Example of setting all the items (defined by title, path, ID, etc.) in $MyList to the same list number item in $MyList2 using the first instance of text 'See more' in $Text as the link's anchor text and setting the link type as 'explanation':

	$MyList.each(anItem1){
		$MyList2.each(anItem2){
			createTextLink(anItem1,anItem2,"See more","explanation");
		};
	};