alex_furer's profile

215 Messages

 • 

3.6K Points

Mon, Jul 19, 2021 12:36 PM

Rename history state by script

I have the issue that when I double click the name of a history state, it becomes editable for a split second and then I can't type a new name. I don't know where this comes from and decided to write a little script that does this for me. But the script doesn't change the name either.

Maybe somebody can point me in the right direction here.

Here's the script:

#target photoshop 

var myDoc = app.activeDocument.name;
var currentHistoryStepName = app.activeDocument.activeHistoryState;
// alert( currentHistoryStepName );
var historyStateNameOnly = currentHistoryStepName.name.replace("HistoryState ", "");
// alert( historyStateNameOnly );
var pmt = prompt ('Type a new history state name', historyStateNameOnly, 'Rename History State');
alert( pmt );
app.activeDocument.activeHistoryState.name = pmt;

It all works well, I get the right name as an alert but the last line does not change the history step name. Maybe someone could quickly test this on a setup where they can rename the history state name by double clicking. Then I know it's because of my base problem that renaming it this way does not work for me.

Responses

No Responses!