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

Get signals from ID Main menu

Community Beginner ,
Jul 18, 2016 Jul 18, 2016

Copy link to clipboard

Copied

II want to to get signals (events, or messges or??) from the Adobe Application main menu.

Is the ActionMgr retrived from gSession the own one for addig an own menu to the ID main menu (already done) and to get the signals from the multiple applications File-Save-item actrions?

TOPICS
SDK

Views

6.1K

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 Expert ,
Jul 18, 2016 Jul 18, 2016

Copy link to clipboard

Copied

You could try using action filters to get notified on whenever a menu item is activated by clicking or using keyboard shortcuts. Refer the sdksample CustomActionFilter for more info on how to do this.

-Manan

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 19, 2016 Jul 19, 2016

Copy link to clipboard

Copied

Hi Manan,

I've build the CustomActionFilter sample.

But that sample is creation its owm sub items under 'WINDOWS' and handles reaction on clicking these additional items.

That logic i've already implemented for my own additional menu.

Now I want to get signaled, when one of the Main menu 'File:Save actions is invoked.

Jochen

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 19, 2016 Jul 19, 2016

Copy link to clipboard

Copied

Hi Manan,

I've looked at the smples and have seen, that the WatchDoc-sampel should implement the functionality I' requring.

But that project can not build successfully, because the Types.r file is missing.

I've looked at my system and found succh a file only under the CS5.5.SDK.

Where to get Types.r for CS2 from?

Jochen

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 19, 2016 Jul 19, 2016

Copy link to clipboard

Copied

Hi Manan,

I've checked now all the file within the DocWch-sample fot the containig string Types.r but did not find anyone.

The message at the build logg claimes that for DocWch.rc the Types.r was not found.

But at DocWch.rc I can not find an naming of Types.r.

May you help here?

Jochen

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 Expert ,
Jul 19, 2016 Jul 19, 2016

Copy link to clipboard

Copied

Yes the .r file is a MACOS thing for CodeWarrior, CodeWarrior was an IDE before Xcode and was used for compiling the CS2 plugins for MAC. Please follow the pointers given by Dirk, and yes as Dirk rightly pointed out you should avoid action filter as much as possible. The reason is that this can be a very computational intensive approach, some of the alternatives that you can use are as follows.

  1. Use the Debug InDesign build and see if you could find any service responder, observer that is fired as a response to activity you are interested in and use them.
  2. As Dirk mentioned you could apply event handlers to specific menu actions using the scripting sdk. This is a very easy task and would just be a single line of code in JS. You could even fire the JS code from within your plugin code.

-Manan

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
Guide ,
Jul 19, 2016 Jul 19, 2016

Copy link to clipboard

Copied

Actually action filters are not computationally intensive - Manan may be mixing this up with command interceptors.

Action filters are only executed when the session is rebuilt - namely the first application startup after a plugin was installed, so don't expect the code to be executed on every restart. Therefor an implementation that goes beyond disabling will require some effort.

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 Expert ,
Jul 19, 2016 Jul 19, 2016

Copy link to clipboard

Copied

Thanks for explanations Dirk, it's a pleasure to read your precious insights every time. I stand corrected.

Cheers,

-Manan

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 19, 2016 Jul 19, 2016

Copy link to clipboard

Copied

Hi Dirk,

we have had a plug-in neraly 10 years ago, which have had the signaling from the main menu File:Save action to the plug-in-code.

Unfortunately this code left.

So I suggest that there should be an easy way to get it done.

I'm still not clear what is the best way.

Jochen

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 19, 2016 Jul 19, 2016

Copy link to clipboard

Copied

BTW. the DocWch-project I've build with Active(Win32) and the Types.r was missed.

Jochen

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 Expert ,
Jul 19, 2016 Jul 19, 2016

Copy link to clipboard

Copied

In order to catch for Save operations you can easily use responders. The signal you could make use of are

//Save

  • kBeforeSaveDocSignalResponderService
  • kAfterSaveDocSignalResponderService

//Save As

  • kBeforeSaveAsDocSignalResponderService
  • kAfterSaveAsDocSignalResponderService

This should help you achieve what you want

-Manan

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 19, 2016 Jul 19, 2016

Copy link to clipboard

Copied

That seems at least to be closer to the solution I'm requiring.

Are these object areaday acticated when the plug-in-startup is processed?

Jochen

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 19, 2016 Jul 19, 2016

Copy link to clipboard

Copied

Hi Mana,

what I should implement to use one or several of these responders?

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 19, 2016 Jul 19, 2016

Copy link to clipboard

Copied

Hi Manan,

should I implement a responderBoss at my fr-file first, or what to do, to use the named responders?

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 Expert ,
Jul 19, 2016 Jul 19, 2016

Copy link to clipboard

Copied

You need to add a boss class in your .fr file, an example would be. The you need to give implementations of the serviceprovider and responder interfaces.

  Class

  {

  kSampleDocResponderServiceBoss,

  kInvalidClass,

  {

  IID_IK2SERVICEPROVIDER, kSampleDocServiceProviderImpl,

  IID_IRESPONDER, kSampleDocResponderImpl,

  }

  },

In the serviceprovider implementation class, add the service ID's you are interested in, look  the sample plugin for more details. In the responder implementation file you write the code that needs to be called when the service you registered sends out a signal.

Look into the SDK programming guide for a more elaborate description

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 19, 2016 Jul 19, 2016

Copy link to clipboard

Copied

Hi Manan,

I've started to port the DocWch-sources into my project.

The Boss classes I've already implemented and have implemengted the relevant

lines into my UIEID.h file.

To my FactoryList I'ved added the lines from the samples FactoryList.

Next I'll refer the cpp-files from the sample into my project.

Hopefully that wil work.

Many thanks so fare!

Kind regards

Jochen Seliger

Manan Joshi <forums_noreply@adobe.com> hat am 19. Juli 2016 um 16:46

geschrieben:

Manan Joshi created the

discussion

"Get signals from ID Main menu"

To view the discussion, visit:

https://forums.adobe.com/message/8886643#8886643

>

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 ,
Sep 21, 2016 Sep 21, 2016

Copy link to clipboard

Copied

Hi Manan,

I had catched kAfterSaveAsDocSignalResponderService and kAfterSaveDocSignalResponderService. They are both raised.

But I can not find a way to set the base directory for the 'SAVE as' popup, I want to catch  kBeforeSaveAsDocSignalResponderService and kBeforeSaveDocSignalResponderService to save the files by my program.

But I have the switch braches for these two serviceIDs in my DocWchResponder, but obviusel they are never raised.

Could ou please let me know, what shall be wrong here?

Jochen

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 ,
Sep 22, 2016 Sep 22, 2016

Copy link to clipboard

Copied

Hi Manan,

I get now kBeforeSaveAsDocSignalResponderService be signaled.

But my CAlert is popped up only after the standard 'Save As' dialog will be processed (the internal path to the saved file will be set).

That seems to me not to be the corresponding stage step.

After saving the document at least once, the signal is popped up at the right stage step.

As I want to save the documents into different file system nodes (into the production orders order case) the  options are

1. To set the 'Save in:'-dialog variable at the standard 'Save As'-dialog (and use that dialog for saving into different folders), or

2. to omit the standard 'Save As' dialog and save my documents by own programm

I prefere the second approach .

May you give my any advice how to get one of these approaches to work propper.

Ragards

Jochen

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 Expert ,
Sep 22, 2016 Sep 22, 2016

Copy link to clipboard

Copied

Assuming that you have exhausted all the options while investigating the first step, lets discuss the second approach. In this either you can create your own menu for this custom save of your's and in the action component of your plugin you can show the user a folder selection dialog and then call the save command.

In case if you want to use the native menu for save, you could use a command interceptor to intercept the save command and fire your own handler for save that shows your dialog to save rather than the one shown in the default workflow.

Hope this gets you started on further investigation to see what suits you best for your workflow

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 ,
Sep 22, 2016 Sep 22, 2016

Copy link to clipboard

Copied

Hi Manan,

indeed I may setup an own Save -Menu-item at my existing own Plug-In-menu with the respective handlers, but that is not really user friendly.

May you give me a hint, how to get signaled directly from the InDesign-'File:Save' and 'File:Save As' menues (to omitt the standard Save As-procedure), or how to manipulate either the dialog-Parameter 'Save in:' or the internal path variable, controlling the showing of the standard 'Save As'-Panel.

Regards

Jochen

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 Expert ,
Sep 22, 2016 Sep 22, 2016

Copy link to clipboard

Copied

Write a command interceptor to get notified when the save command is fired, in a command interceptor you can prevent the command to complete. So what you can do is on getting the notification of the save command fired you can prevent the system command to complete and fire your own workflow with custom dialog.

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 ,
Sep 22, 2016 Sep 22, 2016

Copy link to clipboard

Copied

Hi Manan,

now we are again at my first question.

I've implemented my own menue with sub items and action handler.

But how to access the InDesign File:Save and File:Save As sub items?

Do I need to declare a specail BossClass+ActionComponent for the InDesign 'File'-menu or is a specific ActionComponent enough?

Or is there another way for the interceptor, you have mentioned?

Regards

Jochen

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
Guide ,
Sep 22, 2016 Sep 22, 2016

Copy link to clipboard

Copied

Manan, interfering with the command subsystem by means of command interceptors is a bad idea most of the time. Last time I checked, InDesign only used them for the preview feature of dialogs, to exclude intermediate commands from the command history. And those are simple model operations, while save is doing complicated things to the database that I would not want to suppress.

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 ,
Sep 23, 2016 Sep 23, 2016

Copy link to clipboard

Copied

Hi Dir,

I'l search for IID_IDOCFILEHANDLER, but it's a handler for documents.

I'm looking either for the action component of the File-menu.

Regards

Jochen

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
Guide ,
Sep 24, 2016 Sep 24, 2016

Copy link to clipboard

Copied

IDocFileHandler is the interface for file operations on your document, including save. So if you want to change the Save operation including your modified dialog, you'd go that way.

Most of the time the menu manager does not use the change manager or IObserver notifications, one exception being mouse clicks without action. If you want continue on that wrong trail of intercepting menu actions, focus on IActionFilter.

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