//
// Use this macro to manually unpack a ZPK file.
//
// Usage: 
//		1) place ZPK file in directory where files will be unpacked
//		2) Tool-->Run Macro... and select this macro script file
//		3) Browse and select ZPK file
//

function unpack()
{
	var file = scriptcode.wbGetFileSelection("", "", "ZPK file (*.zpk)|*.zpk|All Files (*.*)|*.*", false);
	if( file == "" ) return;

	var zUnpack = CreateActiveXObject(GenWBProgId("AnsCoreObjects.AnsZUnpack."));

	zUnpack.Open(file);

	var fileList = zUnpack.Contents;

	for (i = 1; i <= fileList.Count; i++)
	{
		var file = fileList.Item(i);

		zUnpack.Restore(file);
	}

	zUnpack.Close();
}


unpack();
//WBScript.Out("Unpacked Files", true);
