Quantcast
Channel: Adobe Community : Popular Discussions - Photoshop Plugin and Companion App SDK
Viewing all articles
Browse latest Browse all 54282

Photoshop CS6 - eventSave callback

$
0
0

Hi everybody,

 

I'm trying to develop my first plugin and I'm experiencing a problem.

I'd like to export a file in a very specific format whenever I save a PSD file, without having to save it in a different step.

The purpose of this file is to be fed to another piece of software, but I don't want the user to deal with it, it should be transparent as far as he's concerned.

I don't need to read it back in Photoshop, it's not a new file format.

I figured that the best way to do so would be to create an Export plugin.

To make it work I also created a second plugin in charge of registering the necessary callback, basically the eventSave callback.

In my OnFileSaved callback method I call the export through a sPSActionControl->Play call.

This workflow works very well when I save a PSD file through a "File/Save" or "File/Save As" call.

Unfortunately it doesn't work when I close an unsaved file and answer yes to the "would you like to save the file first" popup window.

The OnFileSaved function is invoked but the sPSActionControl->Play call fails with a message stating that the Export function is unavailable.

My understanding is that the file is probably already closed when the function is invoked and that Photoshop prevents me from doing anything because the resource is no longer available.

 

My question for you is twofold:

 

- do you know a better way to do what I want to do?

- is there a way to register a before close callback, that would give me an opportunity to export my special file?

 

By the way, I've tried registering the eventAll callback, hoping to find one that would be fired before the eventClose one without any success.

 

Thank you in advance for your help:-)

 

Sebastien


Viewing all articles
Browse latest Browse all 54282

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>