I have 50 history states. I check the file by going File > Revert which adds the action as a history state and then Cmd+ Z to undo. It would useful to have to be able to do this action with keyboard short cut. I am able to capture both of these commands with the script listener. I am failing creating the toggle action tho. I don't undertstand the DOM. function revert() { // ======================================================= var idinvokeCommand = stringIDToTypeID( "invokeCommand" ); var desc133 = new ActionDescriptor(); var idcommandID = stringIDToTypeID( "commandID" ); desc133.putInteger( idcommandID, 34 ); var idkcanDispatchWhileModal = stringIDToTypeID( "kcanDispatchWhileModal" ); desc133.putBoolean( idkcanDispatchWhileModal, true ); executeAction( idinvokeCommand, desc133, DialogModes.NO ); // ======================================================= var idRvrt = charIDToTypeID( "Rvrt" ); executeAction( idRvrt, undefined, DialogModes.NO ); } function undo() { // ======================================================= var idinvokeCommand = stringIDToTypeID( "invokeCommand" ); var desc134 = new ActionDescriptor(); var idcommandID = stringIDToTypeID( "commandID" ); desc134.putInteger( idcommandID, 101 ); var idkcanDispatchWhileModal = stringIDToTypeID( "kcanDispatchWhileModal" ); desc134.putBoolean( idkcanDispatchWhileModal, true ); executeAction( idinvokeCommand, desc134, DialogModes.NO ); } revert (); //undo()
... View more