Hi Mick,
are you able to select a state inside an MSO or can you select the MSO itself?
If so you could rename tha active state with the following ExtendScript (JavaScript) code:
( function()
{
// No document open? Do nothing:
if( app.documents.length == 0 ){ return };
// Nothing or more than one thing selected? Do nothing:
if( app.selection.length != 1 ){ return };
var MSO;
var sel = app.selection[0];
// Identify the MSO in the selection:
if( sel.constructor.name == "MultiStateObject" ){ MSO = sel };
if( sel.parent.constructor.name == "MultiStateObject" ){ MSO = sel.parent };
// MSO not recognized? Throw an error alert:
// MSO not recognized? Throw an error alert:
if( MSO == undefined )
{
alert
(
"To make this work best select the MultiState Object. You selected: "+
"\r\r"+sel.constructor.name
);
return
};
// Identify the active state:
var activeState = MSO.states[ MSO.activeStateIndex ];
// Interface for a new name of the active state:
var result = prompt( "", activeState.name , "Rename the active State to:" );
// User canceled interface or set an empty string as new name? Do nothing:
if( result == undefined || result == "" ){ return };
// Finally rename the active state:
activeState.name = result ;
// OPTIONAL ALERT:
alert( "Done. The active state was renamed." );
}() )
How to save ExtendScript code to a script file, install and execute that script file from InDesign's Scripts Panel see:
https://www.indiscripts.com/pages/help#hd0sb2
Regards,
Uwe Laubender
( ACP )