Tinderbox v9 Icon

exportedString("item",template)


Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Operator First Added: 

Operator Altered: 

 Function   [other Function type actions]

 Item   [operators of similar scope]

 Formatting   [other Formatting operators]

 Baseline

 


The operator exportedString() applies an export template to a note, returning the result as a String.

item designates the note to be exported; it is commonly "this". It is a note name, path or item designator. An attribute may not be used as a placeholder for such information. The exportedString() operator binds 'current' to 'this' note. Formerly, 'current 'was only bound in export templates. In short, this short improve the operator exporting the correct content.

The second argument template has 2 forms.

The exportedString() operator is especially useful in conjunction with the runCommand() operator. You can use exportedString() to assemble the input an external program will require, and then pass that input to the external program.

If you simply wish to transform a string or attribute value (e.g. $Name) into a 'safe' value for use as an HTML/XML element 'id' value, use idEncode().

Examples

exportedString("item",templateFile)

The first form of exportedString takes a reference to a note and the name of a template note and returns the result of applying the template to the note. The first example used just the (unique) template note $Name:, which should be quoted

$MyString = exportedString(this,"tSome_Template"); 

or use the unquoted full $Path for the template:

$MyString = exportedString(this,/Templates/tSome_Template); 

exportedString("item",templateString) 

The second form requires as its second argument is the template string itself which may be literal code or an attribute reference.

$MyString = exportedString(this,^value($Name(parent))^); 

or

$MyString = exportedString(this,$MyTemplateCode);