Copy link to clipboard
Copied
I see the Photoshop SDK has events such as eventOpen, eventSave, etc in the Photoshop SDK. I can sign up for these events from my plugin to be notified when such actions (open, save, respectively) are performed. But these are *notifications*, not *blocking/authorizing callbacks*.
By "blocking/authorizing callbacks", I mean Photoshop invoking my (previously registered) callback with the following conditions:
(i) Photoshop invokes my callback *before* it actually performs the relevant action (eg Open, Save),
(ii) My callback blocks the handling of the event, and
(iii) I can return a "fail" from within my callback, which will cause Photoshop to error out on the action. E.g., Photoshop will fail the Save action, with maybe an error-message that I provide from my callback.
Does Photoshop provide such callbacks? If so, where in the SDK code can I find them?
Thanks.
Copy link to clipboard
Copied
For what it's worth, this isn't the usual meaning of "blocking" in cooperative programming. It would normally mean "capable of stopping execution while waiting for an event". For instance, a save plug-in that waited if a network resource was unavailable would be blocking. Your term is closer to "authorizing". May help you in your searches. I haven't used the Photoshop SDK but in the Acrobat SDK you could create a custom filesystem implementation that prefliltered all operations.
Copy link to clipboard
Copied
Thanks for your response. Yeah I can see "blocking" alone might be confusing, and "authorizing" might be more accurate; accordingly edited the post.
And yes, like you said, Acrobat SDK does provide for such callbacks, via the HFTReplaceEntry API. I don't see this API or any equivalent in the Photoshop SDK.