Tinderbox v9 Icon

document["key"]


Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Operator First Added: 

Operator Altered: 

 Function   [other Function type actions]

 Document   [operators of similar scope]

 Document configuration   [other Document configuration operators]

 9.0.0

 


document

document[key]

returns a dictionary of useful properties of the current document. Three properties of the document are exposed this way:

The values for the above properties values can be accessed individually by supplying the relevant key. Quotes around the key are optional, both forms are illustrated below:

$MyURL = document["url"]; 

$MyFile = document[path]; 

$MyString = document[name]; 

$MyString = document[user-attributes]; 

All four properties return a string value but the first two are usable with the more precise data types shown.

Calling document with no other handling, returns the entire, unformatted document Dictionary contents. To split the items onto separate lines as discrete key:value pairs:

$MyString = document.format("\n"); 

To get the three values (without their keys) on separate lines:

$MyString = document.format("\n").replace("\n[^:]+:","\n").replace("^[^:]+:",""); 

However, a neater and more easily understood method is use the Dictionary.keys method and iterate thus:

	$MyString =;
	document.keys.each[aKey]{
		$MyString = $MyString + document[aKey] + "\n";
	};