You can use the following script to change all private attributes to public in a package.
!INC Local Scripts.EAConstants-JScript
function main()
{
Repository.EnsureOutputVisible( "Script" );
Repository.ClearOutput( "Script" );
// Get the type of element selected in the Project Browser
var treeSelectedType = Repository.GetTreeSelectedItemType();
switch ( treeSelectedType )
{
case otPackage :
{
// Code for when a package is selected
var pkg as EA.Package;
pkg = Repository.GetTreeSelectedObject();
Session.Output("----------------------------------------");
Session.Output("Processing... " + pkg.Name);
for (var i = 0 ; i < pkg.Elements.Count; i++)
{
var element as EA.Element;
element = pkg.Elements.GetAt(i);
Session.Output("Analyzing : " + element.Name);
for (var j = 0; j < element.Attributes.Count; j++)
{
var attrib as EA.Attribute;
attrib = element.Attributes.GetAt(j);
if (attrib.Visibility == "Private")
{
attrib.Visibility = "Public";
attrib.Update();
Session.Output("- Changed attribute :" + attrib.Name);
}
}
element.Update();
element.Refresh();
}
Session.Output("----------------------------------------");
break;
}
default:
{
// Error message
Session.Prompt( "This script does not support items of this type.", promptOK );
}
}
}
main();
TIPS: If you still need some private attributes, you can add additional flag/character in the attribute name, then modify the above script to parse attribute name and only change it to public when you find the flag and remove the flag from the attribute name.