• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

What information can I get from the descriptor in event callback function?

Community Beginner ,
Jun 15, 2011 Jun 15, 2011

Copy link to clipboard

Copied

I have an automation plugin "A-plugin", during startup it uses AddNotify to set a callback waiting for a filter event:
sPSActionControl->AddNotify( pluginRef, eventFilter, CallBack, this );

Then execute an filter plugin "B-plugin", CallBack function will be invoked:
void CallBack( DescriptorEventID eventID, PIActionDescriptor desc, PIDialogRecordOptions opt, void *data ) { ... }

In CallBack, how can I get enough information of "B-plugin" that trigger the event? I've known that A-plugin can get B-plugin's name, just use "keyUsing" as key to query the descriptor, if the result value is B-plugin's name I'll do some more operation. But this method is not reliable since it's hard-coded, B-plugin's name may change (e.g. in another language). So, does anybody know it there any way to get some specific information of B-plugin? Any suggestion will be appreciated.

TOPICS
SDK

Views

894

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
community guidelines

correct answers 1 Correct answer

Adobe Employee , Jun 30, 2011 Jun 30, 2011

For Filters the eventID should be unique. Or in other plug-in cases the keyUsing ID should be unique.

Make sure you generate a unique id for your filter and place that into your HasTerminology resource. Then use that resourceID and StringIDToTypeID to get your eventID. Now your callback will only get called for your plug-in and you know it is B-plugin. Because for A-plugin and C-plugin and X-plugin you generated another id for them to use.

This is from AutomationFilterPiPL.r, the 'AuFi' is ignored

...

Votes

Translate

Translate
Adobe
Community Beginner ,
Jun 30, 2011 Jun 30, 2011

Copy link to clipboard

Copied

sPSActionControl->AddNotify( pluginRef, eventFilter, CallBack, this );

void CallBack( DescriptorEventID eventID, PIActionDescriptor desc, PIDialogRecordOptions opt, void *data ) { ... }

In CallBack function, Can I  get the unique string of the filter other than the filter's name? If the filter has 'aete' resource ?

Votes

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
community guidelines
Adobe Employee ,
Jun 30, 2011 Jun 30, 2011

Copy link to clipboard

Copied

For Filters the eventID should be unique. Or in other plug-in cases the keyUsing ID should be unique.

Make sure you generate a unique id for your filter and place that into your HasTerminology resource. Then use that resourceID and StringIDToTypeID to get your eventID. Now your callback will only get called for your plug-in and you know it is B-plugin. Because for A-plugin and C-plugin and X-plugin you generated another id for them to use.

This is from AutomationFilterPiPL.r, the 'AuFi' is ignored because Photoshop found a string id as the fourth paramater.

You can use the four character codes but the chances of you being unique become less likely.

HasTerminology

{

'AuFi',

'AuFi',

16000,

"adc931a0-cfe2-11d5-98bf-00b0d0204936"

},

Votes

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
community guidelines
Community Beginner ,
Jul 01, 2011 Jul 01, 2011

Copy link to clipboard

Copied

LATEST

Oh, very very thank you. that helps me a lot.

Votes

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
community guidelines