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.
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
...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 ?
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"
},
Copy link to clipboard
Copied
Oh, very very thank you. that helps me a lot.