/*
Folder Javascript Created by Joel Geraci - Acrobat Technical Evangelist - geraci@adobe.com.

This JavaScript was designed to demonstrate adding redaction codes (overlayText) to a "React" annotation.

Configuration:
Each reaction code in the codeArray will create a new button.

Use:
Select one or more annotations and overlayText will be added to each one that is of type "Redact". 

*/

codeArray = ["(b) (1) (A)", "(b) (1) (B)", "(b) (2)"]

function switchRedactionCodeTo(newCode)
{
	this.syncAnnotScan();
	if (this.selectedAnnots)
		{
			for each (annot in this.selectedAnnots)
				{
					if (annot.type == "Redact")
						{
							annot.overlayText = newCode;
						}
				}
		}
	else
		{
			app.alert("no annotations are selected")
		}
}

for each (code in codeArray)
{
	app.addToolButton({
		cName: code,
		cExec: "switchRedactionCodeTo('"+code+"')",
		cTooltext: code,
		cEnable: "event.rc = (app.doc != null)"
	});
	
}


	