Tinderbox v9 Icon

createAdornment([containerStr, ] nameStr)


Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Operator First Added: 

Operator Last Altered: 

Operator Has Optional Arguments: 

 Function  [other Function type actions]

 Item  [operators of similar scope]

 Document configuration  [other Document configuration operators]

 Baseline

 As at baseline

 [More on optional operator arguments]


createAdornment([containerStr, ] nameStr)

New to v9.5.0, the operator createAdornment(), creates an adornment at the designated path. If a note already exists with that path, no new adornment is created.

createAdornment(nameStr)

This creates a new note called nameStr at the designated location, and returns the full path to that note. If the designated note already exists, no new note is created and the operator returns the empty string.

The createAdornment() operator always returns the path to the new (or pre-existing) note. Previously, if the note already existed, the operator returns false.

This function needs no left-side expression argument, i.e. '$SomeAttribute=', to invoke it.

nameStr is typically actually a complete path:

create("/hardware/taps"); 

but if nameStr is a unique note $Name, a new note is created as a child of the current note. For example:

createAdornment("taps"); 

createAdornment(containerStr, nameStr)

A two-argument variant is also offered that allows the container for a new item to be specified, and the new item's $Name. This may be useful if you need to create several notes in the same container, for example is iterating a list with .each(). For example:

createAdornment("/hardware","taps"); 

Or, more pertinently, using a loop variable 'aPlace':

	$SomeList.each(aPlace){
		createAdornment(aPlace,"urgentTasks");
	};

Essentially, the two-input form allows 3 forms of variation:

The createAdornment() operator evaluates its first argument, permitting use of an expression to compute a value. Note that this means that paths should be quoted: createAdornment("/Containers/People/Mark") , as otherwise parts of paths may be evaluated as expressions.

Designators and evaluation

Paths like that below, which mix literal and computed values are not evaluated, nor are inline designators:

createAdornment(/Resources/Test/$MyString) 

Instead use code like this:

	var path="/Resources/Test/"+$MyString;
	createAdornment(path);


A Tinderbox Reference File : Automating Tinderbox : Coding : Action Code : Operators : Full Operator List : createAdornment([containerStr, ] nameStr)