Highlighted

Blocking/Authorizing Callback available via Photoshop SDK?

New Here ,
Sep 07, 2020

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.

TOPICS
Actions and scripting, Feature request, Mac, SDK, Windows

Views

50

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Blocking/Authorizing Callback available via Photoshop SDK?

New Here ,
Sep 07, 2020

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.

TOPICS
Actions and scripting, Feature request, Mac, SDK, Windows

Views

51

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 07, 2020 0
Most Valuable Participant ,
Sep 07, 2020

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 07, 2020 0
New Here ,
Sep 07, 2020

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 07, 2020 0