Can we get the eventUndo?

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

poortip

Can we get the eventUndo?

Post by poortip »

Hi All!

I am designing a plugin for Photoshop CS5 onwards. My plugin has a UI which shows the current background color in an HBox. My problem is as follows:

Suppose there is a text layer whose font color is red. The user then applies blue color to the same layer. He then undoes this action so that the text color is red again.

The problem is that whenever user undoes any such action, my plugin doesn't know it and so the UI displays incorrect information. I want to capture the undoEvent and get my plugin to the same state as that of Photoshop. I found that an event by the name of eventUndo exists in PITerminology.h class. I added code to add notifications for this event. I found that the event does not get called. I looked into the script generated by the Listener plugin and found that eventSelect event gets triggered when user does 'Step backwards'. I require an event that detects 'Step backwards' as well as 'Undo <last action>'. How can I go about this so that my plugin detects whenever user undoes his action?

Thanks!