• Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Hot Door CORE Forum All forums Bugs v
1 2 3 4 Next »
The notifier doesn't trigger the action

 
  • 0 Vote(s) - 0 Average
The notifier doesn't trigger the action
illia.budarov
Offline

Junior Member

Posts: 6
Threads: 5
Joined: Nov 2021
Reputation: 0
#1
02-23-2023, 04:22 AM
Hi

I would like to program some actions when the user clicks the Export button in the File menu and after do the export.

Here the code in plugin startup function:

Code:
hdi::core::Notifier preNotifier(hdi::core::ExportCommandPreNotifierType, HDI_CORE_CALLBACK(class, &obj, func));
__corePlug->dispatcher()->registerNotifier(preNotifier);

hdi::core::Notifier postNotifier(hdi::core::ExportCommandPostNotifierType, HDI_CORE_CALLBACK(class, &obj, func));
__corePlug->dispatcher()->registerNotifier(postNotifier);


However breakpoint doesn't hit the callback function after actions.
For example, notifiers with the types 'NewCommandPreNotifierType' & ''NewCommandPostNotifierType' work well.

Could you help please?
Thanks, Illia
Rick Johnson
Offline

Senior Member

Posts: 318
Threads: 160
Joined: Jan 2014
Reputation: 4
#2
03-04-2023, 12:16 PM
Hi, Illia, I'm just another user, but have been using notifiers for quite a while. Is the code you showed exactly as it appears in your plugin? If your plugin's main class were named "exporter" and you had a callback function defined as void preExportFunc() then your code should look something like this.

Code:
hdi::core::Notifier preNotifier(hdi::core::ExportCommandPreNotifierType,
  HDI_CORE_CALLBACK(exporter::Plugin, this, preExportFunc));

__corePlug->dispatcher()->registerNotifier(preNotifier);

-- Rick
illia.budarov
Offline

Junior Member

Posts: 6
Threads: 5
Joined: Nov 2021
Reputation: 0
#3
03-07-2023, 05:20 AM (This post was last modified: 03-07-2023, 05:20 AM by illia.budarov.)
(03-04-2023, 12:16 PM)Rick Johnson Wrote: Hi, Illia, I'm just another user, but have been using notifiers for quite a while. Is the code you showed exactly as it appears in your plugin? If your plugin's main class were named "exporter" and you had a callback function defined as void preExportFunc() then your code should look something like this.

Code:
hdi::core::Notifier preNotifier(hdi::core::ExportCommandPreNotifierType,
  HDI_CORE_CALLBACK(exporter::Plugin, this, preExportFunc));

__corePlug->dispatcher()->registerNotifier(preNotifier);

-- Rick

Hi, Rick. Thanks for reply. 

I tried many options for passing arguments to the callback of the notifier constructor. I also tried your option, it didn't work either. And as I mentioned above, with other types of notifier the callback works fine.

Please tell me, does the callback with export type work for you?

Thanks, Illia
Rick Johnson
Offline

Senior Member

Posts: 318
Threads: 160
Joined: Jan 2014
Reputation: 4
#4
03-18-2023, 01:32 PM
I tried setting up that callback and then doing all three File > Export options. None of them triggered the callback. Maybe ExportCommandPreNotifierType is for something other than these menu items. I'm sorry this didn't work.

If you download the AI SDK, you can find documentation on the various notifiers here:

Adobe Illustrator 2023 SDK/docs/references/sdkdocs/index.html

There are none there related to export, so I wonder if that could be a CORE-only notifier, or if the SDK docs are just out of date. After all, those docs still reference Adobe Dialog Manager, which has been missing since Illustrator 16.
garrett
Offline

Super Moderator

Posts: 279
Threads: 27
Joined: Nov 2013
Reputation: 2
#5
03-22-2023, 04:12 PM
As Rick mentioned, looking at the SDK will show a macro called kAIExportCommandPreNotifierStr, which is what hdi_core uses under the hood for hdi::core:: ExportCommandPreNotifierType.

If the callback is not firing, then it's possible kAIExportCommandPreNotifierStr refers to some other menu item or that it's broken in the SDK / Illustrator itself. We don't use this notifier ourselves so I cannot comment on its reliability.

If you really want to dig down to find this stuff out you'll have to compile a sample project in the real AI SDK and try using the kAIExportCommandPreNotifierStr notifier manually.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

Linear Mode
Threaded Mode