Simulate failure on save document

Hi everyone,

my plugin is listening to the ‘save’ event, and so far I’m handling two events that are fired whenever the user saves the event - one for the beginning and another for the completion.

The descriptor of such events are as follows:
descriptor.saveStage._value = <either ‘saveBegin’ or ‘saveSucceeded’>

which one is the opposite of ‘saveSucceeded’? Is it ‘saveFailed’ or something like that? Is there any way where I can force Photoshop to fail on a save attempt (just to emulate this event)?

It gets more complicated. In PS there is async saving turned on by default. So PS can save while you work. But this is not the case when you saving using the script. You will simply handle this as any other action. So no need to bother with ‘saveBegin’ or ‘saveSucceeded’.

But if user will save it manually then yes this will help. You could try 1GB file and flash drive and pull out during the saving.

1 Like

I forgot to mention that the reason I’m bothering with ‘saveBegin’ and ‘saveSucceeded’ is that I’m specifically measuring the time that it takes to save.

But your suggestion on how to simulate a failure is really helpful. Thank you @Jarda !